Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef CYTHON_INLINE
571 : #if defined(__clang__)
572 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
573 : #elif defined(__GNUC__)
574 : #define CYTHON_INLINE __inline__
575 : #elif defined(_MSC_VER)
576 : #define CYTHON_INLINE __inline
577 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
578 : #define CYTHON_INLINE inline
579 : #else
580 : #define CYTHON_INLINE
581 : #endif
582 : #endif
583 :
584 : #define __PYX_BUILD_PY_SSIZE_T "n"
585 : #define CYTHON_FORMAT_SSIZE_T "z"
586 : #if PY_MAJOR_VERSION < 3
587 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
588 : #define __Pyx_DefaultClassType PyClass_Type
589 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
590 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
591 : #else
592 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
593 : #define __Pyx_DefaultClassType PyType_Type
594 : #if CYTHON_COMPILING_IN_LIMITED_API
595 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
596 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
597 : PyObject *fv, PyObject *cell, PyObject* fn,
598 : PyObject *name, int fline, PyObject *lnos) {
599 : PyObject *exception_table = NULL;
600 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
601 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
602 : PyObject *version_info;
603 : PyObject *py_minor_version = NULL;
604 : #endif
605 : long minor_version = 0;
606 : PyObject *type, *value, *traceback;
607 : PyErr_Fetch(&type, &value, &traceback);
608 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
609 : minor_version = 11;
610 : #else
611 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
612 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
613 : minor_version = PyLong_AsLong(py_minor_version);
614 : Py_DECREF(py_minor_version);
615 : if (minor_version == -1 && PyErr_Occurred()) goto end;
616 : #endif
617 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
618 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
619 : if (minor_version <= 7) {
620 : (void)p;
621 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
622 : c, n, v, fn, name, fline, lnos, fv, cell);
623 : } else if (minor_version <= 10) {
624 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
625 : c, n, v, fn, name, fline, lnos, fv, cell);
626 : } else {
627 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
628 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
629 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
630 : }
631 : end:
632 : Py_XDECREF(code_type);
633 : Py_XDECREF(exception_table);
634 : Py_XDECREF(types_module);
635 : if (type) {
636 : PyErr_Restore(type, value, traceback);
637 : }
638 : return result;
639 : }
640 : #ifndef CO_OPTIMIZED
641 : #define CO_OPTIMIZED 0x0001
642 : #endif
643 : #ifndef CO_NEWLOCALS
644 : #define CO_NEWLOCALS 0x0002
645 : #endif
646 : #ifndef CO_VARARGS
647 : #define CO_VARARGS 0x0004
648 : #endif
649 : #ifndef CO_VARKEYWORDS
650 : #define CO_VARKEYWORDS 0x0008
651 : #endif
652 : #ifndef CO_ASYNC_GENERATOR
653 : #define CO_ASYNC_GENERATOR 0x0200
654 : #endif
655 : #ifndef CO_GENERATOR
656 : #define CO_GENERATOR 0x0020
657 : #endif
658 : #ifndef CO_COROUTINE
659 : #define CO_COROUTINE 0x0080
660 : #endif
661 : #elif PY_VERSION_HEX >= 0x030B0000
662 12 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
663 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
664 : PyObject *fv, PyObject *cell, PyObject* fn,
665 : PyObject *name, int fline, PyObject *lnos) {
666 12 : PyCodeObject *result;
667 12 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
668 12 : if (!empty_bytes) return NULL;
669 12 : result =
670 : #if PY_VERSION_HEX >= 0x030C0000
671 12 : PyUnstable_Code_NewWithPosOnlyArgs
672 : #else
673 : PyCode_NewWithPosOnlyArgs
674 : #endif
675 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
676 12 : Py_DECREF(empty_bytes);
677 : return result;
678 : }
679 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
680 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
681 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
682 : #else
683 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
684 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
685 : #endif
686 : #endif
687 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
688 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
689 : #else
690 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
691 : #endif
692 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
693 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
694 : #else
695 : #define __Pyx_Py_Is(x, y) ((x) == (y))
696 : #endif
697 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
698 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
699 : #else
700 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
701 : #endif
702 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
703 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
704 : #else
705 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
706 : #endif
707 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
708 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
709 : #else
710 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
711 : #endif
712 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
713 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
714 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
715 : #else
716 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
717 : #endif
718 : #ifndef CO_COROUTINE
719 : #define CO_COROUTINE 0x80
720 : #endif
721 : #ifndef CO_ASYNC_GENERATOR
722 : #define CO_ASYNC_GENERATOR 0x200
723 : #endif
724 : #ifndef Py_TPFLAGS_CHECKTYPES
725 : #define Py_TPFLAGS_CHECKTYPES 0
726 : #endif
727 : #ifndef Py_TPFLAGS_HAVE_INDEX
728 : #define Py_TPFLAGS_HAVE_INDEX 0
729 : #endif
730 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
731 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
732 : #endif
733 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
734 : #define Py_TPFLAGS_HAVE_FINALIZE 0
735 : #endif
736 : #ifndef Py_TPFLAGS_SEQUENCE
737 : #define Py_TPFLAGS_SEQUENCE 0
738 : #endif
739 : #ifndef Py_TPFLAGS_MAPPING
740 : #define Py_TPFLAGS_MAPPING 0
741 : #endif
742 : #ifndef METH_STACKLESS
743 : #define METH_STACKLESS 0
744 : #endif
745 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
746 : #ifndef METH_FASTCALL
747 : #define METH_FASTCALL 0x80
748 : #endif
749 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
750 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
751 : Py_ssize_t nargs, PyObject *kwnames);
752 : #else
753 : #if PY_VERSION_HEX >= 0x030d00A4
754 : # define __Pyx_PyCFunctionFast PyCFunctionFast
755 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
756 : #else
757 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
758 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
759 : #endif
760 : #endif
761 : #if CYTHON_METH_FASTCALL
762 : #define __Pyx_METH_FASTCALL METH_FASTCALL
763 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
764 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
765 : #else
766 : #define __Pyx_METH_FASTCALL METH_VARARGS
767 : #define __Pyx_PyCFunction_FastCall PyCFunction
768 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
769 : #endif
770 : #if CYTHON_VECTORCALL
771 : #define __pyx_vectorcallfunc vectorcallfunc
772 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
773 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
774 : #elif CYTHON_BACKPORT_VECTORCALL
775 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
776 : size_t nargsf, PyObject *kwnames);
777 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
778 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
779 : #else
780 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
781 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
782 : #endif
783 : #if PY_MAJOR_VERSION >= 0x030900B1
784 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
785 : #else
786 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
787 : #endif
788 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
789 : #if CYTHON_COMPILING_IN_CPYTHON
790 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
791 : #elif !CYTHON_COMPILING_IN_LIMITED_API
792 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
793 : #endif
794 : #if CYTHON_COMPILING_IN_CPYTHON
795 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
796 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
797 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
798 : }
799 : #endif
800 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
801 : #if CYTHON_COMPILING_IN_LIMITED_API
802 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
803 : #else
804 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
805 : #endif
806 : }
807 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
808 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
809 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
810 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
811 : #else
812 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
813 : #define __Pyx_PyCMethod PyCMethod
814 : #endif
815 : #ifndef METH_METHOD
816 : #define METH_METHOD 0x200
817 : #endif
818 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
819 : #define PyObject_Malloc(s) PyMem_Malloc(s)
820 : #define PyObject_Free(p) PyMem_Free(p)
821 : #define PyObject_Realloc(p) PyMem_Realloc(p)
822 : #endif
823 : #if CYTHON_COMPILING_IN_LIMITED_API
824 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
825 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
826 : #else
827 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
828 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
829 : #endif
830 : #if CYTHON_COMPILING_IN_LIMITED_API
831 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
832 : #elif !CYTHON_FAST_THREAD_STATE
833 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
834 : #elif PY_VERSION_HEX >= 0x030d00A1
835 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
836 : #elif PY_VERSION_HEX >= 0x03060000
837 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
838 : #elif PY_VERSION_HEX >= 0x03000000
839 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
840 : #else
841 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
842 : #endif
843 : #if CYTHON_COMPILING_IN_LIMITED_API
844 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
845 : {
846 : void *result;
847 : result = PyModule_GetState(op);
848 : if (!result)
849 : Py_FatalError("Couldn't find the module state");
850 : return result;
851 : }
852 : #endif
853 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
854 : #if CYTHON_COMPILING_IN_LIMITED_API
855 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
856 : #else
857 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
858 : #endif
859 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
860 : #include "pythread.h"
861 : #define Py_tss_NEEDS_INIT 0
862 : typedef int Py_tss_t;
863 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
864 : *key = PyThread_create_key();
865 : return 0;
866 : }
867 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
868 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
869 : *key = Py_tss_NEEDS_INIT;
870 : return key;
871 : }
872 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
873 : PyObject_Free(key);
874 : }
875 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
876 : return *key != Py_tss_NEEDS_INIT;
877 : }
878 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
879 : PyThread_delete_key(*key);
880 : *key = Py_tss_NEEDS_INIT;
881 : }
882 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
883 : return PyThread_set_key_value(*key, value);
884 : }
885 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
886 : return PyThread_get_key_value(*key);
887 : }
888 : #endif
889 : #if PY_MAJOR_VERSION < 3
890 : #if CYTHON_COMPILING_IN_PYPY
891 : #if PYPY_VERSION_NUM < 0x07030600
892 : #if defined(__cplusplus) && __cplusplus >= 201402L
893 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
894 : #elif defined(__GNUC__) || defined(__clang__)
895 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
896 : #elif defined(_MSC_VER)
897 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
898 : #endif
899 : static CYTHON_INLINE int PyGILState_Check(void) {
900 : return 0;
901 : }
902 : #else // PYPY_VERSION_NUM < 0x07030600
903 : #endif // PYPY_VERSION_NUM < 0x07030600
904 : #else
905 : static CYTHON_INLINE int PyGILState_Check(void) {
906 : PyThreadState * tstate = _PyThreadState_Current;
907 : return tstate && (tstate == PyGILState_GetThisThreadState());
908 : }
909 : #endif
910 : #endif
911 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
912 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
913 : #else
914 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
915 : #endif
916 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
917 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
918 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
919 : #else
920 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
921 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
922 : #endif
923 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
924 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
925 2624 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
926 2624 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
927 2624 : if (res == NULL) PyErr_Clear();
928 2624 : return res;
929 : }
930 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
931 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
932 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
933 : #else
934 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
935 : #if CYTHON_COMPILING_IN_PYPY
936 : return PyDict_GetItem(dict, name);
937 : #else
938 : PyDictEntry *ep;
939 : PyDictObject *mp = (PyDictObject*) dict;
940 : long hash = ((PyStringObject *) name)->ob_shash;
941 : assert(hash != -1);
942 : ep = (mp->ma_lookup)(mp, name, hash);
943 : if (ep == NULL) {
944 : return NULL;
945 : }
946 : return ep->me_value;
947 : #endif
948 : }
949 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
950 : #endif
951 : #if CYTHON_USE_TYPE_SLOTS
952 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
953 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
954 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
955 : #else
956 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
957 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
958 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
959 : #endif
960 : #if CYTHON_COMPILING_IN_LIMITED_API
961 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
962 : #else
963 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
964 : #endif
965 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
966 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
967 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
968 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
969 : PyObject_GC_Del(obj);\
970 : Py_DECREF(type);\
971 : }
972 : #else
973 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
974 : #endif
975 : #if CYTHON_COMPILING_IN_LIMITED_API
976 : #define CYTHON_PEP393_ENABLED 1
977 : #define __Pyx_PyUnicode_READY(op) (0)
978 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
979 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
980 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
981 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
982 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
983 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
984 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
985 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
986 : #define CYTHON_PEP393_ENABLED 1
987 : #if PY_VERSION_HEX >= 0x030C0000
988 : #define __Pyx_PyUnicode_READY(op) (0)
989 : #else
990 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
991 : 0 : _PyUnicode_Ready((PyObject *)(op)))
992 : #endif
993 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
994 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
995 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
996 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
997 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
998 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
999 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1000 : #if PY_VERSION_HEX >= 0x030C0000
1001 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1002 : #else
1003 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1004 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1005 : #else
1006 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1007 : #endif
1008 : #endif
1009 : #else
1010 : #define CYTHON_PEP393_ENABLED 0
1011 : #define PyUnicode_1BYTE_KIND 1
1012 : #define PyUnicode_2BYTE_KIND 2
1013 : #define PyUnicode_4BYTE_KIND 4
1014 : #define __Pyx_PyUnicode_READY(op) (0)
1015 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1016 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1017 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1018 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1019 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1020 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1021 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1023 : #endif
1024 : #if CYTHON_COMPILING_IN_PYPY
1025 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1026 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1027 : #else
1028 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1029 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1030 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1031 : #endif
1032 : #if CYTHON_COMPILING_IN_PYPY
1033 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1034 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1035 : #endif
1036 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1037 : #undef PyUnicode_Contains
1038 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1039 : #endif
1040 : #if !defined(PyByteArray_Check)
1041 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1042 : #endif
1043 : #if !defined(PyObject_Format)
1044 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1045 : #endif
1046 : #endif
1047 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1048 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1049 : #if PY_MAJOR_VERSION >= 3
1050 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1051 : #else
1052 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1053 : #endif
1054 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1055 : #define PyObject_ASCII(o) PyObject_Repr(o)
1056 : #endif
1057 : #if PY_MAJOR_VERSION >= 3
1058 : #define PyBaseString_Type PyUnicode_Type
1059 : #define PyStringObject PyUnicodeObject
1060 : #define PyString_Type PyUnicode_Type
1061 : #define PyString_Check PyUnicode_Check
1062 : #define PyString_CheckExact PyUnicode_CheckExact
1063 : #ifndef PyObject_Unicode
1064 : #define PyObject_Unicode PyObject_Str
1065 : #endif
1066 : #endif
1067 : #if PY_MAJOR_VERSION >= 3
1068 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1069 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1070 : #else
1071 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1072 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1073 : #endif
1074 : #if CYTHON_COMPILING_IN_CPYTHON
1075 : #define __Pyx_PySequence_ListKeepNew(obj)\
1076 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1077 : #else
1078 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1079 : #endif
1080 : #ifndef PySet_CheckExact
1081 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1082 : #endif
1083 : #if PY_VERSION_HEX >= 0x030900A4
1084 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1085 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1086 : #else
1087 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1088 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1089 : #endif
1090 : #if CYTHON_ASSUME_SAFE_MACROS
1091 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1092 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1093 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1094 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1095 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1096 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1097 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1098 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1099 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1100 : #else
1101 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1102 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1103 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1104 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1105 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1106 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1107 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1108 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1109 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1110 : #endif
1111 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1112 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1113 : #else
1114 9 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1115 9 : PyObject *module = PyImport_AddModule(name);
1116 9 : Py_XINCREF(module);
1117 9 : return module;
1118 : }
1119 : #endif
1120 : #if PY_MAJOR_VERSION >= 3
1121 : #define PyIntObject PyLongObject
1122 : #define PyInt_Type PyLong_Type
1123 : #define PyInt_Check(op) PyLong_Check(op)
1124 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1125 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1126 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1127 : #define PyInt_FromString PyLong_FromString
1128 : #define PyInt_FromUnicode PyLong_FromUnicode
1129 : #define PyInt_FromLong PyLong_FromLong
1130 : #define PyInt_FromSize_t PyLong_FromSize_t
1131 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1132 : #define PyInt_AsLong PyLong_AsLong
1133 : #define PyInt_AS_LONG PyLong_AS_LONG
1134 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1135 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1136 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1137 : #define PyNumber_Int PyNumber_Long
1138 : #else
1139 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1140 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1141 : #endif
1142 : #if PY_MAJOR_VERSION >= 3
1143 : #define PyBoolObject PyLongObject
1144 : #endif
1145 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1146 : #ifndef PyUnicode_InternFromString
1147 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1148 : #endif
1149 : #endif
1150 : #if PY_VERSION_HEX < 0x030200A4
1151 : typedef long Py_hash_t;
1152 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1153 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1154 : #else
1155 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1156 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1157 : #endif
1158 : #if CYTHON_USE_ASYNC_SLOTS
1159 : #if PY_VERSION_HEX >= 0x030500B1
1160 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1161 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1162 : #else
1163 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1164 : #endif
1165 : #else
1166 : #define __Pyx_PyType_AsAsync(obj) NULL
1167 : #endif
1168 : #ifndef __Pyx_PyAsyncMethodsStruct
1169 : typedef struct {
1170 : unaryfunc am_await;
1171 : unaryfunc am_aiter;
1172 : unaryfunc am_anext;
1173 : } __Pyx_PyAsyncMethodsStruct;
1174 : #endif
1175 :
1176 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1177 : #if !defined(_USE_MATH_DEFINES)
1178 : #define _USE_MATH_DEFINES
1179 : #endif
1180 : #endif
1181 : #include <math.h>
1182 : #ifdef NAN
1183 : #define __PYX_NAN() ((float) NAN)
1184 : #else
1185 : static CYTHON_INLINE float __PYX_NAN() {
1186 : float value;
1187 : memset(&value, 0xFF, sizeof(value));
1188 : return value;
1189 : }
1190 : #endif
1191 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1192 : #define __Pyx_truncl trunc
1193 : #else
1194 : #define __Pyx_truncl truncl
1195 : #endif
1196 :
1197 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1198 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1199 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1200 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1201 :
1202 : #ifdef CYTHON_EXTERN_C
1203 : #undef __PYX_EXTERN_C
1204 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1205 : #elif defined(__PYX_EXTERN_C)
1206 : #ifdef _MSC_VER
1207 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1208 : #else
1209 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1210 : #endif
1211 : #else
1212 : #ifdef __cplusplus
1213 : #define __PYX_EXTERN_C extern "C"
1214 : #else
1215 : #define __PYX_EXTERN_C extern
1216 : #endif
1217 : #endif
1218 :
1219 : #define __PYX_HAVE__scipy__linalg___decomp_update
1220 : #define __PYX_HAVE_API__scipy__linalg___decomp_update
1221 : /* Early includes */
1222 : #include <string.h>
1223 : #include <stdlib.h>
1224 : #include <limits.h>
1225 : #include <float.h>
1226 : #include <math.h>
1227 : #include <stdio.h>
1228 :
1229 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1230 :
1231 : #include "numpy/arrayobject.h"
1232 : #include "numpy/ndarrayobject.h"
1233 : #include "numpy/ndarraytypes.h"
1234 : #include "numpy/arrayscalars.h"
1235 : #include "numpy/ufuncobject.h"
1236 : #ifdef _OPENMP
1237 : #include <omp.h>
1238 : #endif /* _OPENMP */
1239 :
1240 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1241 : #define CYTHON_WITHOUT_ASSERTIONS
1242 : #endif
1243 :
1244 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1245 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1246 :
1247 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1248 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1249 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1250 : #define __PYX_DEFAULT_STRING_ENCODING ""
1251 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1252 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1253 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1254 : #define __Pyx_long_cast(x) ((long)x)
1255 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1256 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1257 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1258 : likely(v < (type)PY_SSIZE_T_MAX ||\
1259 : v == (type)PY_SSIZE_T_MAX) &&\
1260 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1261 : v == (type)PY_SSIZE_T_MIN))) ||\
1262 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1263 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1264 : v == (type)PY_SSIZE_T_MAX))) )
1265 0 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1266 0 : return (size_t) i < (size_t) limit;
1267 : }
1268 : #if defined (__cplusplus) && __cplusplus >= 201103L
1269 : #include <cstdlib>
1270 : #define __Pyx_sst_abs(value) std::abs(value)
1271 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1272 : #define __Pyx_sst_abs(value) abs(value)
1273 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1274 : #define __Pyx_sst_abs(value) labs(value)
1275 : #elif defined (_MSC_VER)
1276 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1277 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1278 : #define __Pyx_sst_abs(value) llabs(value)
1279 : #elif defined (__GNUC__)
1280 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1281 : #else
1282 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1283 : #endif
1284 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1285 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1286 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1287 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1288 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1289 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1290 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1291 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1292 : #if PY_MAJOR_VERSION < 3
1293 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1294 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1295 : #else
1296 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1297 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1298 : #endif
1299 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1300 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1301 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1302 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1303 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1304 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1305 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1306 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1307 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1308 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1309 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1310 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1311 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1312 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1313 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1314 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1315 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1316 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1317 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1318 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1319 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1320 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1321 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1322 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1323 : #define __Pyx_PySequence_Tuple(obj)\
1324 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1325 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1326 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1327 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1328 : #if CYTHON_ASSUME_SAFE_MACROS
1329 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1330 : #else
1331 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1332 : #endif
1333 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1334 : #if PY_MAJOR_VERSION >= 3
1335 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1336 : #else
1337 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1338 : #endif
1339 : #if CYTHON_USE_PYLONG_INTERNALS
1340 : #if PY_VERSION_HEX >= 0x030C00A7
1341 : #ifndef _PyLong_SIGN_MASK
1342 : #define _PyLong_SIGN_MASK 3
1343 : #endif
1344 : #ifndef _PyLong_NON_SIZE_BITS
1345 : #define _PyLong_NON_SIZE_BITS 3
1346 : #endif
1347 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1348 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1349 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1350 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1351 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1352 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1353 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1354 : #define __Pyx_PyLong_SignedDigitCount(x)\
1355 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1356 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1357 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1358 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1359 : #else
1360 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1361 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1362 : #endif
1363 : typedef Py_ssize_t __Pyx_compact_pylong;
1364 : typedef size_t __Pyx_compact_upylong;
1365 : #else
1366 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1367 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1368 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1369 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1370 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1371 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1372 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1373 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1374 : #define __Pyx_PyLong_CompactValue(x)\
1375 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1376 : typedef sdigit __Pyx_compact_pylong;
1377 : typedef digit __Pyx_compact_upylong;
1378 : #endif
1379 : #if PY_VERSION_HEX >= 0x030C00A5
1380 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1381 : #else
1382 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1383 : #endif
1384 : #endif
1385 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1386 : #include <string.h>
1387 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1388 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1389 : PyObject* sys;
1390 : PyObject* default_encoding = NULL;
1391 : PyObject* ascii_chars_u = NULL;
1392 : PyObject* ascii_chars_b = NULL;
1393 : const char* default_encoding_c;
1394 : sys = PyImport_ImportModule("sys");
1395 : if (!sys) goto bad;
1396 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1397 : Py_DECREF(sys);
1398 : if (!default_encoding) goto bad;
1399 : default_encoding_c = PyBytes_AsString(default_encoding);
1400 : if (!default_encoding_c) goto bad;
1401 : if (strcmp(default_encoding_c, "ascii") == 0) {
1402 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1403 : } else {
1404 : char ascii_chars[128];
1405 : int c;
1406 : for (c = 0; c < 128; c++) {
1407 : ascii_chars[c] = (char) c;
1408 : }
1409 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1410 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1411 : if (!ascii_chars_u) goto bad;
1412 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1413 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1414 : PyErr_Format(
1415 : PyExc_ValueError,
1416 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1417 : default_encoding_c);
1418 : goto bad;
1419 : }
1420 : Py_DECREF(ascii_chars_u);
1421 : Py_DECREF(ascii_chars_b);
1422 : }
1423 : Py_DECREF(default_encoding);
1424 : return 0;
1425 : bad:
1426 : Py_XDECREF(default_encoding);
1427 : Py_XDECREF(ascii_chars_u);
1428 : Py_XDECREF(ascii_chars_b);
1429 : return -1;
1430 : }
1431 : #endif
1432 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1433 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1434 : #else
1435 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1436 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1437 : #include <string.h>
1438 : static char* __PYX_DEFAULT_STRING_ENCODING;
1439 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1440 : PyObject* sys;
1441 : PyObject* default_encoding = NULL;
1442 : char* default_encoding_c;
1443 : sys = PyImport_ImportModule("sys");
1444 : if (!sys) goto bad;
1445 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1446 : Py_DECREF(sys);
1447 : if (!default_encoding) goto bad;
1448 : default_encoding_c = PyBytes_AsString(default_encoding);
1449 : if (!default_encoding_c) goto bad;
1450 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1451 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1452 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1453 : Py_DECREF(default_encoding);
1454 : return 0;
1455 : bad:
1456 : Py_XDECREF(default_encoding);
1457 : return -1;
1458 : }
1459 : #endif
1460 : #endif
1461 :
1462 :
1463 : /* Test for GCC > 2.95 */
1464 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1465 : #define likely(x) __builtin_expect(!!(x), 1)
1466 : #define unlikely(x) __builtin_expect(!!(x), 0)
1467 : #else /* !__GNUC__ or GCC < 2.95 */
1468 : #define likely(x) (x)
1469 : #define unlikely(x) (x)
1470 : #endif /* __GNUC__ */
1471 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1472 :
1473 : #if !CYTHON_USE_MODULE_STATE
1474 : static PyObject *__pyx_m = NULL;
1475 : #endif
1476 : static int __pyx_lineno;
1477 : static int __pyx_clineno = 0;
1478 : static const char * __pyx_cfilenm = __FILE__;
1479 : static const char *__pyx_filename;
1480 :
1481 : /* Header.proto */
1482 : #if !defined(CYTHON_CCOMPLEX)
1483 : #if defined(__cplusplus)
1484 : #define CYTHON_CCOMPLEX 1
1485 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1486 : #define CYTHON_CCOMPLEX 1
1487 : #else
1488 : #define CYTHON_CCOMPLEX 0
1489 : #endif
1490 : #endif
1491 : #if CYTHON_CCOMPLEX
1492 : #ifdef __cplusplus
1493 : #include <complex>
1494 : #else
1495 : #include <complex.h>
1496 : #endif
1497 : #endif
1498 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1499 : #undef _Complex_I
1500 : #define _Complex_I 1.0fj
1501 : #endif
1502 :
1503 : /* #### Code section: filename_table ### */
1504 :
1505 : static const char *__pyx_f[] = {
1506 : "scipy/linalg/_decomp_update.pyx",
1507 : "__init__.cython-30.pxd",
1508 : "type.pxd",
1509 : };
1510 : /* #### Code section: utility_code_proto_before_types ### */
1511 : /* ForceInitThreads.proto */
1512 : #ifndef __PYX_FORCE_INIT_THREADS
1513 : #define __PYX_FORCE_INIT_THREADS 0
1514 : #endif
1515 :
1516 : /* NoFastGil.proto */
1517 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1518 : #define __Pyx_PyGILState_Release PyGILState_Release
1519 : #define __Pyx_FastGIL_Remember()
1520 : #define __Pyx_FastGIL_Forget()
1521 : #define __Pyx_FastGilFuncInit()
1522 :
1523 : /* #### Code section: numeric_typedefs ### */
1524 :
1525 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1526 : * # in Cython to enable them only on the right systems.
1527 : *
1528 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1529 : * ctypedef npy_int16 int16_t
1530 : * ctypedef npy_int32 int32_t
1531 : */
1532 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1533 :
1534 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1535 : *
1536 : * ctypedef npy_int8 int8_t
1537 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1538 : * ctypedef npy_int32 int32_t
1539 : * ctypedef npy_int64 int64_t
1540 : */
1541 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1542 :
1543 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1544 : * ctypedef npy_int8 int8_t
1545 : * ctypedef npy_int16 int16_t
1546 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1547 : * ctypedef npy_int64 int64_t
1548 : * #ctypedef npy_int96 int96_t
1549 : */
1550 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1551 :
1552 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1553 : * ctypedef npy_int16 int16_t
1554 : * ctypedef npy_int32 int32_t
1555 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1556 : * #ctypedef npy_int96 int96_t
1557 : * #ctypedef npy_int128 int128_t
1558 : */
1559 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1560 :
1561 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1562 : * #ctypedef npy_int128 int128_t
1563 : *
1564 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1565 : * ctypedef npy_uint16 uint16_t
1566 : * ctypedef npy_uint32 uint32_t
1567 : */
1568 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1569 :
1570 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1571 : *
1572 : * ctypedef npy_uint8 uint8_t
1573 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1574 : * ctypedef npy_uint32 uint32_t
1575 : * ctypedef npy_uint64 uint64_t
1576 : */
1577 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1578 :
1579 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1580 : * ctypedef npy_uint8 uint8_t
1581 : * ctypedef npy_uint16 uint16_t
1582 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1583 : * ctypedef npy_uint64 uint64_t
1584 : * #ctypedef npy_uint96 uint96_t
1585 : */
1586 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1587 :
1588 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1589 : * ctypedef npy_uint16 uint16_t
1590 : * ctypedef npy_uint32 uint32_t
1591 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1592 : * #ctypedef npy_uint96 uint96_t
1593 : * #ctypedef npy_uint128 uint128_t
1594 : */
1595 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1596 :
1597 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1598 : * #ctypedef npy_uint128 uint128_t
1599 : *
1600 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1601 : * ctypedef npy_float64 float64_t
1602 : * #ctypedef npy_float80 float80_t
1603 : */
1604 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1605 :
1606 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1607 : *
1608 : * ctypedef npy_float32 float32_t
1609 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1610 : * #ctypedef npy_float80 float80_t
1611 : * #ctypedef npy_float128 float128_t
1612 : */
1613 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1614 :
1615 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1616 : * ctypedef double complex complex128_t
1617 : *
1618 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1619 : * ctypedef npy_ulonglong ulonglong_t
1620 : *
1621 : */
1622 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1623 :
1624 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1625 : *
1626 : * ctypedef npy_longlong longlong_t
1627 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1628 : *
1629 : * ctypedef npy_intp intp_t
1630 : */
1631 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1632 :
1633 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1634 : * ctypedef npy_ulonglong ulonglong_t
1635 : *
1636 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1637 : * ctypedef npy_uintp uintp_t
1638 : *
1639 : */
1640 : typedef npy_intp __pyx_t_5numpy_intp_t;
1641 :
1642 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1643 : *
1644 : * ctypedef npy_intp intp_t
1645 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1646 : *
1647 : * ctypedef npy_double float_t
1648 : */
1649 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1650 :
1651 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1652 : * ctypedef npy_uintp uintp_t
1653 : *
1654 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1655 : * ctypedef npy_double double_t
1656 : * ctypedef npy_longdouble longdouble_t
1657 : */
1658 : typedef npy_double __pyx_t_5numpy_float_t;
1659 :
1660 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1661 : *
1662 : * ctypedef npy_double float_t
1663 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1664 : * ctypedef npy_longdouble longdouble_t
1665 : *
1666 : */
1667 : typedef npy_double __pyx_t_5numpy_double_t;
1668 :
1669 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1670 : * ctypedef npy_double float_t
1671 : * ctypedef npy_double double_t
1672 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1673 : *
1674 : * ctypedef float complex cfloat_t
1675 : */
1676 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1677 :
1678 : /* "cython_blas.pxd":17
1679 : * # The original libraries should be linked directly.
1680 : *
1681 : * ctypedef float s # <<<<<<<<<<<<<<
1682 : * ctypedef double d
1683 : * ctypedef float complex c
1684 : */
1685 : typedef float __pyx_t_5scipy_6linalg_11cython_blas_s;
1686 :
1687 : /* "cython_blas.pxd":18
1688 : *
1689 : * ctypedef float s
1690 : * ctypedef double d # <<<<<<<<<<<<<<
1691 : * ctypedef float complex c
1692 : * ctypedef double complex z
1693 : */
1694 : typedef double __pyx_t_5scipy_6linalg_11cython_blas_d;
1695 :
1696 : /* "cython_lapack.pxd":17
1697 : * # The original libraries should be linked directly.
1698 : *
1699 : * ctypedef float s # <<<<<<<<<<<<<<
1700 : * ctypedef double d
1701 : * ctypedef float complex c
1702 : */
1703 : typedef float __pyx_t_5scipy_6linalg_13cython_lapack_s;
1704 :
1705 : /* "cython_lapack.pxd":18
1706 : *
1707 : * ctypedef float s
1708 : * ctypedef double d # <<<<<<<<<<<<<<
1709 : * ctypedef float complex c
1710 : * ctypedef double complex z
1711 : */
1712 : typedef double __pyx_t_5scipy_6linalg_13cython_lapack_d;
1713 : /* #### Code section: complex_type_declarations ### */
1714 : /* Declarations.proto */
1715 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1716 : #ifdef __cplusplus
1717 : typedef ::std::complex< float > __pyx_t_float_complex;
1718 : #else
1719 : typedef float _Complex __pyx_t_float_complex;
1720 : #endif
1721 : #else
1722 : typedef struct { float real, imag; } __pyx_t_float_complex;
1723 : #endif
1724 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1725 :
1726 : /* Declarations.proto */
1727 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1728 : #ifdef __cplusplus
1729 : typedef ::std::complex< double > __pyx_t_double_complex;
1730 : #else
1731 : typedef double _Complex __pyx_t_double_complex;
1732 : #endif
1733 : #else
1734 : typedef struct { double real, imag; } __pyx_t_double_complex;
1735 : #endif
1736 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1737 :
1738 : /* Declarations.proto */
1739 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1740 : #ifdef __cplusplus
1741 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1742 : #else
1743 : typedef long double _Complex __pyx_t_long_double_complex;
1744 : #endif
1745 : #else
1746 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1747 : #endif
1748 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1749 :
1750 : /* #### Code section: type_declarations ### */
1751 :
1752 : /*--- Type declarations ---*/
1753 :
1754 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1755 : *
1756 : * # Iterator API added in v1.6
1757 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1758 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1759 : *
1760 : */
1761 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1762 :
1763 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1764 : * # Iterator API added in v1.6
1765 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1766 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1767 : *
1768 : * cdef extern from "numpy/arrayobject.h":
1769 : */
1770 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1771 :
1772 : /* "cython_lapack.pxd":24
1773 : * # Function pointer type declarations for
1774 : * # gees and gges families of functions.
1775 : * ctypedef bint cselect1(c*) # <<<<<<<<<<<<<<
1776 : * ctypedef bint cselect2(c*, c*)
1777 : * ctypedef bint dselect2(d*, d*)
1778 : */
1779 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect1(__pyx_t_float_complex *);
1780 :
1781 : /* "cython_lapack.pxd":25
1782 : * # gees and gges families of functions.
1783 : * ctypedef bint cselect1(c*)
1784 : * ctypedef bint cselect2(c*, c*) # <<<<<<<<<<<<<<
1785 : * ctypedef bint dselect2(d*, d*)
1786 : * ctypedef bint dselect3(d*, d*, d*)
1787 : */
1788 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_cselect2(__pyx_t_float_complex *, __pyx_t_float_complex *);
1789 :
1790 : /* "cython_lapack.pxd":26
1791 : * ctypedef bint cselect1(c*)
1792 : * ctypedef bint cselect2(c*, c*)
1793 : * ctypedef bint dselect2(d*, d*) # <<<<<<<<<<<<<<
1794 : * ctypedef bint dselect3(d*, d*, d*)
1795 : * ctypedef bint sselect2(s*, s*)
1796 : */
1797 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect2(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1798 :
1799 : /* "cython_lapack.pxd":27
1800 : * ctypedef bint cselect2(c*, c*)
1801 : * ctypedef bint dselect2(d*, d*)
1802 : * ctypedef bint dselect3(d*, d*, d*) # <<<<<<<<<<<<<<
1803 : * ctypedef bint sselect2(s*, s*)
1804 : * ctypedef bint sselect3(s*, s*, s*)
1805 : */
1806 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_dselect3(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *);
1807 :
1808 : /* "cython_lapack.pxd":28
1809 : * ctypedef bint dselect2(d*, d*)
1810 : * ctypedef bint dselect3(d*, d*, d*)
1811 : * ctypedef bint sselect2(s*, s*) # <<<<<<<<<<<<<<
1812 : * ctypedef bint sselect3(s*, s*, s*)
1813 : * ctypedef bint zselect1(z*)
1814 : */
1815 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect2(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1816 :
1817 : /* "cython_lapack.pxd":29
1818 : * ctypedef bint dselect3(d*, d*, d*)
1819 : * ctypedef bint sselect2(s*, s*)
1820 : * ctypedef bint sselect3(s*, s*, s*) # <<<<<<<<<<<<<<
1821 : * ctypedef bint zselect1(z*)
1822 : * ctypedef bint zselect2(z*, z*)
1823 : */
1824 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_sselect3(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *);
1825 :
1826 : /* "cython_lapack.pxd":30
1827 : * ctypedef bint sselect2(s*, s*)
1828 : * ctypedef bint sselect3(s*, s*, s*)
1829 : * ctypedef bint zselect1(z*) # <<<<<<<<<<<<<<
1830 : * ctypedef bint zselect2(z*, z*)
1831 : *
1832 : */
1833 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect1(__pyx_t_double_complex *);
1834 :
1835 : /* "cython_lapack.pxd":31
1836 : * ctypedef bint sselect3(s*, s*, s*)
1837 : * ctypedef bint zselect1(z*)
1838 : * ctypedef bint zselect2(z*, z*) # <<<<<<<<<<<<<<
1839 : *
1840 : * cdef void cbbcsd(char *jobu1, char *jobu2, char *jobv1t, char *jobv2t, char *trans, int *m, int *p, int *q, s *theta, s *phi, c *u1, int *ldu1, c *u2, int *ldu2, c *v1t, int *ldv1t, c *v2t, int *ldv2t, s *b11d, s *b11e, s *b12d, s *b12e, s *b21d, s *b21e, s *b22d, s *b22e, s *rwork, int *lrwork, int *info) noexcept nogil
1841 : */
1842 : typedef int __pyx_t_5scipy_6linalg_13cython_lapack_zselect2(__pyx_t_double_complex *, __pyx_t_double_complex *);
1843 : /* #### Code section: utility_code_proto ### */
1844 :
1845 : /* --- Runtime support code (head) --- */
1846 : /* Refnanny.proto */
1847 : #ifndef CYTHON_REFNANNY
1848 : #define CYTHON_REFNANNY 0
1849 : #endif
1850 : #if CYTHON_REFNANNY
1851 : typedef struct {
1852 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
1853 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
1854 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
1855 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
1856 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
1857 : void (*FinishContext)(void**);
1858 : } __Pyx_RefNannyAPIStruct;
1859 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1860 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1861 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1862 : #ifdef WITH_THREAD
1863 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1864 : if (acquire_gil) {\
1865 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1866 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1867 : PyGILState_Release(__pyx_gilstate_save);\
1868 : } else {\
1869 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1870 : }
1871 : #define __Pyx_RefNannyFinishContextNogil() {\
1872 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1873 : __Pyx_RefNannyFinishContext();\
1874 : PyGILState_Release(__pyx_gilstate_save);\
1875 : }
1876 : #else
1877 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1878 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
1879 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
1880 : #endif
1881 : #define __Pyx_RefNannyFinishContextNogil() {\
1882 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1883 : __Pyx_RefNannyFinishContext();\
1884 : PyGILState_Release(__pyx_gilstate_save);\
1885 : }
1886 : #define __Pyx_RefNannyFinishContext()\
1887 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1888 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1889 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1890 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1891 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1892 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1893 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1894 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1895 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1896 : #else
1897 : #define __Pyx_RefNannyDeclarations
1898 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
1899 : #define __Pyx_RefNannyFinishContextNogil()
1900 : #define __Pyx_RefNannyFinishContext()
1901 : #define __Pyx_INCREF(r) Py_INCREF(r)
1902 : #define __Pyx_DECREF(r) Py_DECREF(r)
1903 : #define __Pyx_GOTREF(r)
1904 : #define __Pyx_GIVEREF(r)
1905 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
1906 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
1907 : #define __Pyx_XGOTREF(r)
1908 : #define __Pyx_XGIVEREF(r)
1909 : #endif
1910 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
1911 : PyObject *tmp = (PyObject *) r;\
1912 : r = v; Py_XDECREF(tmp);\
1913 : } while (0)
1914 : #define __Pyx_XDECREF_SET(r, v) do {\
1915 : PyObject *tmp = (PyObject *) r;\
1916 : r = v; __Pyx_XDECREF(tmp);\
1917 : } while (0)
1918 : #define __Pyx_DECREF_SET(r, v) do {\
1919 : PyObject *tmp = (PyObject *) r;\
1920 : r = v; __Pyx_DECREF(tmp);\
1921 : } while (0)
1922 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1923 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1924 :
1925 : /* PyErrExceptionMatches.proto */
1926 : #if CYTHON_FAST_THREAD_STATE
1927 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1928 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1929 : #else
1930 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1931 : #endif
1932 :
1933 : /* PyThreadStateGet.proto */
1934 : #if CYTHON_FAST_THREAD_STATE
1935 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1936 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1937 : #if PY_VERSION_HEX >= 0x030C00A6
1938 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
1939 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
1940 : #else
1941 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
1942 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
1943 : #endif
1944 : #else
1945 : #define __Pyx_PyThreadState_declare
1946 : #define __Pyx_PyThreadState_assign
1947 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
1948 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
1949 : #endif
1950 :
1951 : /* PyErrFetchRestore.proto */
1952 : #if CYTHON_FAST_THREAD_STATE
1953 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1954 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1955 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1956 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1957 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1958 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1959 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1960 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
1961 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1962 : #else
1963 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1964 : #endif
1965 : #else
1966 : #define __Pyx_PyErr_Clear() PyErr_Clear()
1967 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1968 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1969 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1970 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1971 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1972 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1973 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1974 : #endif
1975 :
1976 : /* PyObjectGetAttrStr.proto */
1977 : #if CYTHON_USE_TYPE_SLOTS
1978 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1979 : #else
1980 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1981 : #endif
1982 :
1983 : /* PyObjectGetAttrStrNoError.proto */
1984 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1985 :
1986 : /* GetBuiltinName.proto */
1987 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1988 :
1989 : /* GetTopmostException.proto */
1990 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
1991 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1992 : #endif
1993 :
1994 : /* SaveResetException.proto */
1995 : #if CYTHON_FAST_THREAD_STATE
1996 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1997 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1998 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1999 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2000 : #else
2001 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2002 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2003 : #endif
2004 :
2005 : /* GetException.proto */
2006 : #if CYTHON_FAST_THREAD_STATE
2007 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2008 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2009 : #else
2010 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2011 : #endif
2012 :
2013 : /* PyObjectCall.proto */
2014 : #if CYTHON_COMPILING_IN_CPYTHON
2015 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2016 : #else
2017 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2018 : #endif
2019 :
2020 : /* RaiseException.proto */
2021 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2022 :
2023 : /* WriteUnraisableException.proto */
2024 : static void __Pyx_WriteUnraisable(const char *name, int clineno,
2025 : int lineno, const char *filename,
2026 : int full_traceback, int nogil);
2027 :
2028 : /* TupleAndListFromArray.proto */
2029 : #if CYTHON_COMPILING_IN_CPYTHON
2030 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2031 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2032 : #endif
2033 :
2034 : /* IncludeStringH.proto */
2035 : #include <string.h>
2036 :
2037 : /* BytesEquals.proto */
2038 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2039 :
2040 : /* UnicodeEquals.proto */
2041 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2042 :
2043 : /* fastcall.proto */
2044 : #if CYTHON_AVOID_BORROWED_REFS
2045 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2046 : #elif CYTHON_ASSUME_SAFE_MACROS
2047 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2048 : #else
2049 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2050 : #endif
2051 : #if CYTHON_AVOID_BORROWED_REFS
2052 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2053 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2054 : #else
2055 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2056 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2057 : #endif
2058 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2059 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2060 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2061 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2062 : #if CYTHON_METH_FASTCALL
2063 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2064 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2065 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2066 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2067 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2068 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2069 : #else
2070 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2071 : #endif
2072 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2073 : to have the same reference counting */
2074 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2075 : #else
2076 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2077 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2078 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2079 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2080 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2081 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2082 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2083 : #endif
2084 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2085 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2086 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2087 : #else
2088 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2089 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2090 : #endif
2091 :
2092 : /* RaiseArgTupleInvalid.proto */
2093 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2094 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2095 :
2096 : /* RaiseDoubleKeywords.proto */
2097 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2098 :
2099 : /* ParseKeywords.proto */
2100 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2101 : PyObject **argnames[],
2102 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2103 : const char* function_name);
2104 :
2105 : /* ExtTypeTest.proto */
2106 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2107 :
2108 : /* PyDictVersioning.proto */
2109 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2110 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2111 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2112 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2113 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2114 : (cache_var) = (value);
2115 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2116 : static PY_UINT64_T __pyx_dict_version = 0;\
2117 : static PyObject *__pyx_dict_cached_value = NULL;\
2118 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2119 : (VAR) = __pyx_dict_cached_value;\
2120 : } else {\
2121 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2122 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2123 : }\
2124 : }
2125 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2126 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2127 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2128 : #else
2129 : #define __PYX_GET_DICT_VERSION(dict) (0)
2130 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2131 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2132 : #endif
2133 :
2134 : /* GetModuleGlobalName.proto */
2135 : #if CYTHON_USE_DICT_VERSIONS
2136 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2137 : static PY_UINT64_T __pyx_dict_version = 0;\
2138 : static PyObject *__pyx_dict_cached_value = NULL;\
2139 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2140 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2141 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2142 : } while(0)
2143 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2144 : PY_UINT64_T __pyx_dict_version;\
2145 : PyObject *__pyx_dict_cached_value;\
2146 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2147 : } while(0)
2148 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2149 : #else
2150 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2151 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2152 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2153 : #endif
2154 :
2155 : /* PyFunctionFastCall.proto */
2156 : #if CYTHON_FAST_PYCALL
2157 : #if !CYTHON_VECTORCALL
2158 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2159 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2160 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2161 : #endif
2162 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2163 : (sizeof(char [1 - 2*!(cond)]) - 1)
2164 : #ifndef Py_MEMBER_SIZE
2165 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2166 : #endif
2167 : #if !CYTHON_VECTORCALL
2168 : #if PY_VERSION_HEX >= 0x03080000
2169 : #include "frameobject.h"
2170 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2171 : #ifndef Py_BUILD_CORE
2172 : #define Py_BUILD_CORE 1
2173 : #endif
2174 : #include "internal/pycore_frame.h"
2175 : #endif
2176 : #define __Pxy_PyFrame_Initialize_Offsets()
2177 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2178 : #else
2179 : static size_t __pyx_pyframe_localsplus_offset = 0;
2180 : #include "frameobject.h"
2181 : #define __Pxy_PyFrame_Initialize_Offsets()\
2182 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2183 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2184 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2185 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2186 : #endif
2187 : #endif
2188 : #endif
2189 :
2190 : /* PyObjectCallMethO.proto */
2191 : #if CYTHON_COMPILING_IN_CPYTHON
2192 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2193 : #endif
2194 :
2195 : /* PyObjectFastCall.proto */
2196 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2197 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2198 :
2199 : /* PyObject_Unicode.proto */
2200 : #if PY_MAJOR_VERSION >= 3
2201 : #define __Pyx_PyObject_Unicode(obj)\
2202 : (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2203 : #else
2204 : #define __Pyx_PyObject_Unicode(obj)\
2205 : (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2206 : #endif
2207 :
2208 : /* GetAttr.proto */
2209 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2210 :
2211 : /* JoinPyUnicode.proto */
2212 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2213 : Py_UCS4 max_char);
2214 :
2215 : /* PyObjectCallOneArg.proto */
2216 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2217 :
2218 : /* RaiseTooManyValuesToUnpack.proto */
2219 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2220 :
2221 : /* RaiseNeedMoreValuesToUnpack.proto */
2222 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2223 :
2224 : /* RaiseNoneIterError.proto */
2225 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2226 :
2227 : /* GetItemInt.proto */
2228 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2229 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2230 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2231 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2232 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2233 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2234 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2235 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2236 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2237 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2238 : int wraparound, int boundscheck);
2239 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2240 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2241 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2242 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2243 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2244 : int wraparound, int boundscheck);
2245 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2246 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2247 : int is_list, int wraparound, int boundscheck);
2248 :
2249 : /* ObjectGetItem.proto */
2250 : #if CYTHON_USE_TYPE_SLOTS
2251 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2252 : #else
2253 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2254 : #endif
2255 :
2256 : /* TypeImport.proto */
2257 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2258 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2259 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2260 : #include <stdalign.h>
2261 : #endif
2262 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2263 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2264 : #else
2265 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2266 : #endif
2267 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2268 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2269 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2270 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2271 : };
2272 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2273 : #endif
2274 :
2275 : /* Import.proto */
2276 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2277 :
2278 : /* ImportFrom.proto */
2279 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2280 :
2281 : /* ImportDottedModule.proto */
2282 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2283 : #if PY_MAJOR_VERSION >= 3
2284 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2285 : #endif
2286 :
2287 : /* IncludeStructmemberH.proto */
2288 : #include <structmember.h>
2289 :
2290 : /* FixUpExtensionType.proto */
2291 : #if CYTHON_USE_TYPE_SPECS
2292 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2293 : #endif
2294 :
2295 : /* FetchSharedCythonModule.proto */
2296 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2297 :
2298 : /* FetchCommonType.proto */
2299 : #if !CYTHON_USE_TYPE_SPECS
2300 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2301 : #else
2302 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2303 : #endif
2304 :
2305 : /* PyMethodNew.proto */
2306 : #if CYTHON_COMPILING_IN_LIMITED_API
2307 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2308 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2309 : CYTHON_UNUSED_VAR(typ);
2310 : if (!self)
2311 : return __Pyx_NewRef(func);
2312 : typesModule = PyImport_ImportModule("types");
2313 : if (!typesModule) return NULL;
2314 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2315 : Py_DECREF(typesModule);
2316 : if (!methodType) return NULL;
2317 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2318 : Py_DECREF(methodType);
2319 : return result;
2320 : }
2321 : #elif PY_MAJOR_VERSION >= 3
2322 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2323 0 : CYTHON_UNUSED_VAR(typ);
2324 0 : if (!self)
2325 0 : return __Pyx_NewRef(func);
2326 0 : return PyMethod_New(func, self);
2327 : }
2328 : #else
2329 : #define __Pyx_PyMethod_New PyMethod_New
2330 : #endif
2331 :
2332 : /* PyVectorcallFastCallDict.proto */
2333 : #if CYTHON_METH_FASTCALL
2334 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2335 : #endif
2336 :
2337 : /* CythonFunctionShared.proto */
2338 : #define __Pyx_CyFunction_USED
2339 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2340 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2341 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2342 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2343 : #define __Pyx_CyFunction_GetClosure(f)\
2344 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2345 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2346 : #define __Pyx_CyFunction_GetClassObj(f)\
2347 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2348 : #else
2349 : #define __Pyx_CyFunction_GetClassObj(f)\
2350 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2351 : #endif
2352 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2353 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2354 : #define __Pyx_CyFunction_Defaults(type, f)\
2355 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2356 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2357 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2358 : typedef struct {
2359 : #if CYTHON_COMPILING_IN_LIMITED_API
2360 : PyObject_HEAD
2361 : PyObject *func;
2362 : #elif PY_VERSION_HEX < 0x030900B1
2363 : PyCFunctionObject func;
2364 : #else
2365 : PyCMethodObject func;
2366 : #endif
2367 : #if CYTHON_BACKPORT_VECTORCALL
2368 : __pyx_vectorcallfunc func_vectorcall;
2369 : #endif
2370 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2371 : PyObject *func_weakreflist;
2372 : #endif
2373 : PyObject *func_dict;
2374 : PyObject *func_name;
2375 : PyObject *func_qualname;
2376 : PyObject *func_doc;
2377 : PyObject *func_globals;
2378 : PyObject *func_code;
2379 : PyObject *func_closure;
2380 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2381 : PyObject *func_classobj;
2382 : #endif
2383 : void *defaults;
2384 : int defaults_pyobjects;
2385 : size_t defaults_size;
2386 : int flags;
2387 : PyObject *defaults_tuple;
2388 : PyObject *defaults_kwdict;
2389 : PyObject *(*defaults_getter)(PyObject *);
2390 : PyObject *func_annotations;
2391 : PyObject *func_is_coroutine;
2392 : } __pyx_CyFunctionObject;
2393 : #undef __Pyx_CyOrPyCFunction_Check
2394 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2395 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2396 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2397 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2398 : #undef __Pyx_IsSameCFunction
2399 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2400 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2401 : int flags, PyObject* qualname,
2402 : PyObject *closure,
2403 : PyObject *module, PyObject *globals,
2404 : PyObject* code);
2405 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2406 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2407 : size_t size,
2408 : int pyobjects);
2409 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2410 : PyObject *tuple);
2411 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2412 : PyObject *dict);
2413 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2414 : PyObject *dict);
2415 : static int __pyx_CyFunction_init(PyObject *module);
2416 : #if CYTHON_METH_FASTCALL
2417 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2418 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2419 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2420 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2421 : #if CYTHON_BACKPORT_VECTORCALL
2422 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
2423 : #else
2424 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2425 : #endif
2426 : #endif
2427 :
2428 : /* CythonFunction.proto */
2429 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2430 : int flags, PyObject* qualname,
2431 : PyObject *closure,
2432 : PyObject *module, PyObject *globals,
2433 : PyObject* code);
2434 :
2435 : /* CLineInTraceback.proto */
2436 : #ifdef CYTHON_CLINE_IN_TRACEBACK
2437 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2438 : #else
2439 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2440 : #endif
2441 :
2442 : /* CodeObjectCache.proto */
2443 : #if !CYTHON_COMPILING_IN_LIMITED_API
2444 : typedef struct {
2445 : PyCodeObject* code_object;
2446 : int code_line;
2447 : } __Pyx_CodeObjectCacheEntry;
2448 : struct __Pyx_CodeObjectCache {
2449 : int count;
2450 : int max_count;
2451 : __Pyx_CodeObjectCacheEntry* entries;
2452 : };
2453 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2454 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2455 : static PyCodeObject *__pyx_find_code_object(int code_line);
2456 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2457 : #endif
2458 :
2459 : /* AddTraceback.proto */
2460 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
2461 : int py_line, const char *filename);
2462 :
2463 : /* RealImag.proto */
2464 : #if CYTHON_CCOMPLEX
2465 : #ifdef __cplusplus
2466 : #define __Pyx_CREAL(z) ((z).real())
2467 : #define __Pyx_CIMAG(z) ((z).imag())
2468 : #else
2469 : #define __Pyx_CREAL(z) (__real__(z))
2470 : #define __Pyx_CIMAG(z) (__imag__(z))
2471 : #endif
2472 : #else
2473 : #define __Pyx_CREAL(z) ((z).real)
2474 : #define __Pyx_CIMAG(z) ((z).imag)
2475 : #endif
2476 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2477 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2478 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2479 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2480 : #else
2481 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2482 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2483 : #endif
2484 :
2485 : /* Arithmetic.proto */
2486 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2487 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
2488 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
2489 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
2490 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
2491 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
2492 : #define __Pyx_c_neg_float(a) (-(a))
2493 : #ifdef __cplusplus
2494 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2495 : #define __Pyx_c_conj_float(z) (::std::conj(z))
2496 : #if 1
2497 : #define __Pyx_c_abs_float(z) (::std::abs(z))
2498 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2499 : #endif
2500 : #else
2501 : #define __Pyx_c_is_zero_float(z) ((z)==0)
2502 : #define __Pyx_c_conj_float(z) (conjf(z))
2503 : #if 1
2504 : #define __Pyx_c_abs_float(z) (cabsf(z))
2505 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2506 : #endif
2507 : #endif
2508 : #else
2509 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2510 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2511 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2512 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2513 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2514 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2515 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2516 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2517 : #if 1
2518 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2519 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2520 : #endif
2521 : #endif
2522 :
2523 : /* Arithmetic.proto */
2524 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2525 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
2526 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
2527 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
2528 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
2529 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
2530 : #define __Pyx_c_neg_double(a) (-(a))
2531 : #ifdef __cplusplus
2532 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2533 : #define __Pyx_c_conj_double(z) (::std::conj(z))
2534 : #if 1
2535 : #define __Pyx_c_abs_double(z) (::std::abs(z))
2536 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2537 : #endif
2538 : #else
2539 : #define __Pyx_c_is_zero_double(z) ((z)==0)
2540 : #define __Pyx_c_conj_double(z) (conj(z))
2541 : #if 1
2542 : #define __Pyx_c_abs_double(z) (cabs(z))
2543 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2544 : #endif
2545 : #endif
2546 : #else
2547 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2548 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2549 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2550 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2551 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2552 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2553 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2554 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2555 : #if 1
2556 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2557 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2558 : #endif
2559 : #endif
2560 :
2561 : /* GCCDiagnostics.proto */
2562 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2563 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2564 : #endif
2565 :
2566 : /* Arithmetic.proto */
2567 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2568 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
2569 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
2570 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
2571 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
2572 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
2573 : #define __Pyx_c_neg_long__double(a) (-(a))
2574 : #ifdef __cplusplus
2575 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
2576 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
2577 : #if 1
2578 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
2579 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
2580 : #endif
2581 : #else
2582 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
2583 : #define __Pyx_c_conj_long__double(z) (conjl(z))
2584 : #if 1
2585 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
2586 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
2587 : #endif
2588 : #endif
2589 : #else
2590 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2591 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2592 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2593 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2594 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2595 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
2596 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
2597 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
2598 : #if 1
2599 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
2600 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
2601 : #endif
2602 : #endif
2603 :
2604 : /* CIntFromPy.proto */
2605 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2606 :
2607 : /* CIntToPy.proto */
2608 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2609 :
2610 : /* CIntToPy.proto */
2611 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2612 :
2613 : /* CIntToPy.proto */
2614 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value);
2615 :
2616 : /* FormatTypeName.proto */
2617 : #if CYTHON_COMPILING_IN_LIMITED_API
2618 : typedef PyObject *__Pyx_TypeName;
2619 : #define __Pyx_FMT_TYPENAME "%U"
2620 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
2621 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2622 : #else
2623 : typedef const char *__Pyx_TypeName;
2624 : #define __Pyx_FMT_TYPENAME "%.200s"
2625 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
2626 : #define __Pyx_DECREF_TypeName(obj)
2627 : #endif
2628 :
2629 : /* CIntFromPy.proto */
2630 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2631 :
2632 : /* FastTypeChecks.proto */
2633 : #if CYTHON_COMPILING_IN_CPYTHON
2634 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2635 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2636 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2637 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2638 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2639 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2640 : #else
2641 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2642 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2643 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2644 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2645 : #endif
2646 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2647 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2648 :
2649 : /* CheckBinaryVersion.proto */
2650 : static unsigned long __Pyx_get_runtime_version(void);
2651 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
2652 :
2653 : /* FunctionImport.proto */
2654 : static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2655 :
2656 : /* InitStrings.proto */
2657 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2658 :
2659 : /* #### Code section: module_declarations ### */
2660 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
2661 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
2662 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
2663 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
2664 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
2665 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
2666 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2667 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2668 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2669 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2670 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2671 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
2672 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
2673 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
2674 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
2675 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
2676 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
2677 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
2678 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
2679 :
2680 : /* Module declarations from "cython" */
2681 :
2682 : /* Module declarations from "libc.string" */
2683 :
2684 : /* Module declarations from "libc.stdlib" */
2685 :
2686 : /* Module declarations from "libc.limits" */
2687 :
2688 : /* Module declarations from "libc.float" */
2689 :
2690 : /* Module declarations from "libc.stdio" */
2691 :
2692 : /* Module declarations from "libc" */
2693 :
2694 : /* Module declarations from "libc.math" */
2695 :
2696 : /* Module declarations from "__builtin__" */
2697 :
2698 : /* Module declarations from "cpython.type" */
2699 :
2700 : /* Module declarations from "cpython" */
2701 :
2702 : /* Module declarations from "cpython.object" */
2703 :
2704 : /* Module declarations from "cpython.ref" */
2705 :
2706 : /* Module declarations from "numpy" */
2707 :
2708 : /* Module declarations from "numpy" */
2709 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
2710 :
2711 : /* Module declarations from "scipy.linalg.cython_blas" */
2712 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_caxpy)(int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2713 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_ccopy)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2714 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgemm)(char *, char *, int *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
2715 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgemv)(char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
2716 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_cgeru)(int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2717 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_cscal)(int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *); /*proto*/
2718 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_cswap)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2719 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_ctrmm)(char *, char *, char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2720 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_daxpy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2721 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dcopy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2722 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dgemm)(char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2723 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dgemv)(char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2724 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dger)(int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2725 : static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dnrm2)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2726 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_drot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *); /*proto*/
2727 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dscal)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2728 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dswap)(int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2729 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_dtrmm)(char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *); /*proto*/
2730 : static __pyx_t_5scipy_6linalg_11cython_blas_d (*__pyx_f_5scipy_6linalg_11cython_blas_dznrm2)(int *, __pyx_t_double_complex *, int *); /*proto*/
2731 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_saxpy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2732 : static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_scnrm2)(int *, __pyx_t_float_complex *, int *); /*proto*/
2733 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_scopy)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2734 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_sgemm)(char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2735 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_sgemv)(char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2736 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_sger)(int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2737 : static __pyx_t_5scipy_6linalg_11cython_blas_s (*__pyx_f_5scipy_6linalg_11cython_blas_snrm2)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2738 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_srot)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *); /*proto*/
2739 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_sscal)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2740 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_sswap)(int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2741 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_strmm)(char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *); /*proto*/
2742 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_zaxpy)(int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2743 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_zcopy)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2744 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgemm)(char *, char *, int *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
2745 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgemv)(char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
2746 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_zgeru)(int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2747 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_zscal)(int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *); /*proto*/
2748 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_zswap)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2749 : static void (*__pyx_f_5scipy_6linalg_11cython_blas_ztrmm)(char *, char *, char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2750 :
2751 : /* Module declarations from "scipy.linalg.cython_lapack" */
2752 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_cgeqrf)(int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, int *); /*proto*/
2753 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_clarf)(char *, int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *); /*proto*/
2754 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_clarfg)(int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *); /*proto*/
2755 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_clartg)(__pyx_t_float_complex *, __pyx_t_float_complex *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_float_complex *, __pyx_t_float_complex *); /*proto*/
2756 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_crot)(int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_float_complex *); /*proto*/
2757 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_cunmqr)(char *, char *, int *, int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int *); /*proto*/
2758 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dgeqrf)(int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *); /*proto*/
2759 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dlarf)(char *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *); /*proto*/
2760 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dlarfg)(int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *); /*proto*/
2761 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dlartg)(__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *); /*proto*/
2762 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_dormqr)(char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *); /*proto*/
2763 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_sgeqrf)(int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *); /*proto*/
2764 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_slarf)(char *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *); /*proto*/
2765 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_slarfg)(int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *); /*proto*/
2766 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_slartg)(__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *); /*proto*/
2767 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_sormqr)(char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *); /*proto*/
2768 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zgeqrf)(int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, int *); /*proto*/
2769 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zlarf)(char *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *); /*proto*/
2770 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zlarfg)(int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *); /*proto*/
2771 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zlartg)(__pyx_t_double_complex *, __pyx_t_double_complex *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_double_complex *, __pyx_t_double_complex *); /*proto*/
2772 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zrot)(int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_double_complex *); /*proto*/
2773 : static void (*__pyx_f_5scipy_6linalg_13cython_lapack_zunmqr)(char *, char *, int *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int *); /*proto*/
2774 :
2775 : /* Module declarations from "scipy.linalg" */
2776 :
2777 : /* Module declarations from "scipy.linalg._decomp_update" */
2778 : static int __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
2779 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_form_qTu(PyArrayObject *, PyArrayObject *, void *, int *, int); /*proto*/
2780 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_validate_array(PyArrayObject *, int); /*proto*/
2781 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(PyObject *, PyObject *, int, int, int, int, int); /*proto*/
2782 : static void *__pyx_f_5scipy_6linalg_14_decomp_update_extract(PyArrayObject *, int *); /*proto*/
2783 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_qr_insert_row(PyObject *, PyObject *, PyObject *, int, int, int); /*proto*/
2784 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_qr_insert_col(PyObject *, PyObject *, PyObject *, int, PyObject *, int, int); /*proto*/
2785 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(float *, int *, int, int); /*proto*/
2786 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(double *, int *, int, int); /*proto*/
2787 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_t_float_complex *, int *, int, int); /*proto*/
2788 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_t_double_complex *, int *, int, int); /*proto*/
2789 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(float *, int *, int); /*proto*/
2790 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(double *, int *, int); /*proto*/
2791 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_t_float_complex *, int *, int); /*proto*/
2792 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_t_double_complex *, int *, int); /*proto*/
2793 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(float *, int *, int); /*proto*/
2794 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(double *, int *, int); /*proto*/
2795 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_t_float_complex *, int *, int); /*proto*/
2796 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_t_double_complex *, int *, int); /*proto*/
2797 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(float *, int *, int); /*proto*/
2798 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(double *, int *, int); /*proto*/
2799 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_t_float_complex *, int *, int); /*proto*/
2800 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_t_double_complex *, int *, int); /*proto*/
2801 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(int, float *, int, float *, int); /*proto*/
2802 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(int, double *, int, double *, int); /*proto*/
2803 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(int, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int); /*proto*/
2804 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(int, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int); /*proto*/
2805 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_swap(int, float *, int, float *, int); /*proto*/
2806 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_swap(int, double *, int, double *, int); /*proto*/
2807 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_swap(int, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int); /*proto*/
2808 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_swap(int, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int); /*proto*/
2809 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(int, float, float *, int); /*proto*/
2810 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(int, double, double *, int); /*proto*/
2811 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(int, __pyx_t_float_complex, __pyx_t_float_complex *, int); /*proto*/
2812 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(int, __pyx_t_double_complex, __pyx_t_double_complex *, int); /*proto*/
2813 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int, float, float *, int, float *, int); /*proto*/
2814 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int, double, double *, int, double *, int); /*proto*/
2815 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int, __pyx_t_float_complex, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int); /*proto*/
2816 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int, __pyx_t_double_complex, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int); /*proto*/
2817 : static CYTHON_INLINE float __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int, float *, int); /*proto*/
2818 : static CYTHON_INLINE double __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int, double *, int); /*proto*/
2819 : static CYTHON_INLINE __pyx_t_float_complex __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int, __pyx_t_float_complex *, int); /*proto*/
2820 : static CYTHON_INLINE __pyx_t_double_complex __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int, __pyx_t_double_complex *, int); /*proto*/
2821 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(float *, float *, float *, float *); /*proto*/
2822 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(double *, double *, double *, double *); /*proto*/
2823 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_t_float_complex *, __pyx_t_float_complex *, __pyx_t_float_complex *, __pyx_t_float_complex *); /*proto*/
2824 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_t_double_complex *, __pyx_t_double_complex *, __pyx_t_double_complex *, __pyx_t_double_complex *); /*proto*/
2825 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(int, float *, int, float *, int, float, float); /*proto*/
2826 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(int, double *, int, double *, int, double, double); /*proto*/
2827 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(int, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int, __pyx_t_float_complex, __pyx_t_float_complex); /*proto*/
2828 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(int, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int, __pyx_t_double_complex, __pyx_t_double_complex); /*proto*/
2829 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int, float *, float *, int, float *); /*proto*/
2830 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int, double *, double *, int, double *); /*proto*/
2831 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int, __pyx_t_float_complex *, __pyx_t_float_complex *, int, __pyx_t_float_complex *); /*proto*/
2832 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int, __pyx_t_double_complex *, __pyx_t_double_complex *, int, __pyx_t_double_complex *); /*proto*/
2833 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *, int, int, float *, int, float, float *, int, float *); /*proto*/
2834 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *, int, int, double *, int, double, double *, int, double *); /*proto*/
2835 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *, int, int, __pyx_t_float_complex *, int, __pyx_t_float_complex, __pyx_t_float_complex *, int, __pyx_t_float_complex *); /*proto*/
2836 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *, int, int, __pyx_t_double_complex *, int, __pyx_t_double_complex, __pyx_t_double_complex *, int, __pyx_t_double_complex *); /*proto*/
2837 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ger(int, int, float, float *, int, float *, int, float *, int); /*proto*/
2838 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ger(int, int, double, double *, int, double *, int, double *, int); /*proto*/
2839 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ger(int, int, __pyx_t_float_complex, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int); /*proto*/
2840 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ger(int, int, __pyx_t_double_complex, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int); /*proto*/
2841 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *, int, int, float, float *, int, float *, int, float, float *, int); /*proto*/
2842 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *, int, int, double, double *, int, double *, int, double, double *, int); /*proto*/
2843 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *, int, int, __pyx_t_float_complex, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int, __pyx_t_float_complex, __pyx_t_float_complex *, int); /*proto*/
2844 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *, int, int, __pyx_t_double_complex, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int, __pyx_t_double_complex, __pyx_t_double_complex *, int); /*proto*/
2845 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *, char *, int, int, int, float, float *, int, float *, int, float, float *, int); /*proto*/
2846 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *, char *, int, int, int, double, double *, int, double *, int, double, double *, int); /*proto*/
2847 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *, char *, int, int, int, __pyx_t_float_complex, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int, __pyx_t_float_complex, __pyx_t_float_complex *, int); /*proto*/
2848 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *, char *, int, int, int, __pyx_t_double_complex, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int, __pyx_t_double_complex, __pyx_t_double_complex *, int); /*proto*/
2849 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *, char *, char *, char *, int, int, float, float *, int, float *, int); /*proto*/
2850 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *, char *, char *, char *, int, int, double, double *, int, double *, int); /*proto*/
2851 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *, char *, char *, char *, int, int, __pyx_t_float_complex, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int); /*proto*/
2852 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *, char *, char *, char *, int, int, __pyx_t_double_complex, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int); /*proto*/
2853 : static CYTHON_INLINE int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int, int, float *, int, float *, float *, int); /*proto*/
2854 : static CYTHON_INLINE int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int, int, double *, int, double *, double *, int); /*proto*/
2855 : static CYTHON_INLINE int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int, int, __pyx_t_float_complex *, int, __pyx_t_float_complex *, __pyx_t_float_complex *, int); /*proto*/
2856 : static CYTHON_INLINE int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int, int, __pyx_t_double_complex *, int, __pyx_t_double_complex *, __pyx_t_double_complex *, int); /*proto*/
2857 : static CYTHON_INLINE int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *, char *, int, int, int, float *, int, float *, float *, int, float *, int); /*proto*/
2858 : static CYTHON_INLINE int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *, char *, int, int, int, double *, int, double *, double *, int, double *, int); /*proto*/
2859 : static CYTHON_INLINE int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *, char *, int, int, int, __pyx_t_float_complex *, int, __pyx_t_float_complex *, __pyx_t_float_complex *, int, __pyx_t_float_complex *, int); /*proto*/
2860 : static CYTHON_INLINE int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *, char *, int, int, int, __pyx_t_double_complex *, int, __pyx_t_double_complex *, __pyx_t_double_complex *, int, __pyx_t_double_complex *, int); /*proto*/
2861 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(int, float *, int *); /*proto*/
2862 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(int, double *, int *); /*proto*/
2863 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(int, __pyx_t_float_complex *, int *); /*proto*/
2864 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(int, __pyx_t_double_complex *, int *); /*proto*/
2865 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(int, int, float *, int *); /*proto*/
2866 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(int, int, double *, int *); /*proto*/
2867 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(int, int, __pyx_t_float_complex *, int *); /*proto*/
2868 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(int, int, __pyx_t_double_complex *, int *); /*proto*/
2869 : static float __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(float); /*proto*/
2870 : static double __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(double); /*proto*/
2871 : static __pyx_t_float_complex __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(__pyx_t_float_complex); /*proto*/
2872 : static __pyx_t_double_complex __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(__pyx_t_double_complex); /*proto*/
2873 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(float, float); /*proto*/
2874 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(double, double); /*proto*/
2875 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_t_float_complex, __pyx_t_float_complex); /*proto*/
2876 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_t_double_complex, __pyx_t_double_complex); /*proto*/
2877 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(float, float); /*proto*/
2878 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(double, double); /*proto*/
2879 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_t_float_complex, __pyx_t_float_complex); /*proto*/
2880 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_t_double_complex, __pyx_t_double_complex); /*proto*/
2881 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(float, float); /*proto*/
2882 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(double, double); /*proto*/
2883 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_t_float_complex, __pyx_t_float_complex); /*proto*/
2884 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_t_double_complex, __pyx_t_double_complex); /*proto*/
2885 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int, int, float *, int *, int, int, float *, float *); /*proto*/
2886 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int, int, double *, int *, int, int, double *, double *); /*proto*/
2887 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int, int, __pyx_t_float_complex *, int *, int, int, __pyx_t_float_complex *, __pyx_t_float_complex *); /*proto*/
2888 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int, int, __pyx_t_double_complex *, int *, int, int, __pyx_t_double_complex *, __pyx_t_double_complex *); /*proto*/
2889 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int, int, float *, int *, int, float *, int *, int, int, int); /*proto*/
2890 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int, int, double *, int *, int, double *, int *, int, int, int); /*proto*/
2891 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int, int, __pyx_t_float_complex *, int *, int, __pyx_t_float_complex *, int *, int, int, int); /*proto*/
2892 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int, int, __pyx_t_double_complex *, int *, int, __pyx_t_double_complex *, int *, int, int, int); /*proto*/
2893 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int, int, float *, int *, float *, int *, int, int); /*proto*/
2894 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int, int, double *, int *, double *, int *, int, int); /*proto*/
2895 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int, int); /*proto*/
2896 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int, int); /*proto*/
2897 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int, int, int, float *, int *, float *, int *, int); /*proto*/
2898 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int, int, int, double *, int *, double *, int *, int); /*proto*/
2899 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int, int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int); /*proto*/
2900 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int, int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int); /*proto*/
2901 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int, int, int, float *, int *, float *, int *, int, int); /*proto*/
2902 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int, int, int, double *, int *, double *, int *, int, int); /*proto*/
2903 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int, int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int, int); /*proto*/
2904 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int, int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int, int); /*proto*/
2905 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int, int, float *, int *, float *, int *, float *, int *, int); /*proto*/
2906 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int, int, double *, int *, double *, int *, double *, int *, int); /*proto*/
2907 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int); /*proto*/
2908 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int); /*proto*/
2909 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int, int, float *, int *, float *, int *, int); /*proto*/
2910 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int, int, double *, int *, double *, int *, int); /*proto*/
2911 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int); /*proto*/
2912 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int); /*proto*/
2913 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int, int, float *, int *, float *, int *, float *, int *, int, int); /*proto*/
2914 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int, int, double *, int *, double *, int *, double *, int *, int, int); /*proto*/
2915 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int, int); /*proto*/
2916 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int, int); /*proto*/
2917 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int, int, float *, int *, float *, int *, int, int); /*proto*/
2918 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int, int, double *, int *, double *, int *, int, int); /*proto*/
2919 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int, int); /*proto*/
2920 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int, int); /*proto*/
2921 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int, int, float *, int *, float *, int *, float *, int *, int, int, int, float *); /*proto*/
2922 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int, int, double *, int *, double *, int *, double *, int *, int, int, int, double *); /*proto*/
2923 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int, int, int, __pyx_t_float_complex *); /*proto*/
2924 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int, int, int, __pyx_t_double_complex *); /*proto*/
2925 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int, int, float *, int *, float *, int *, int); /*proto*/
2926 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int, int, double *, int *, double *, int *, int); /*proto*/
2927 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int); /*proto*/
2928 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int); /*proto*/
2929 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int, int, float *, int *, float *, int *, int, int); /*proto*/
2930 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int, int, double *, int *, double *, int *, int, int); /*proto*/
2931 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int, int); /*proto*/
2932 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int, int); /*proto*/
2933 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int, int, float *, int *, int, float *, int *, float *, int *, float *, int *, float *, int *); /*proto*/
2934 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int, int, double *, int *, int, double *, int *, double *, int *, double *, int *, double *, int *); /*proto*/
2935 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int, int, __pyx_t_float_complex *, int *, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2936 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int, int, __pyx_t_double_complex *, int *, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2937 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int, int, int, float *, int *, int, float *, int *, float *, int *, float *, int *, float *, int *); /*proto*/
2938 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int, int, int, double *, int *, int, double *, int *, double *, int *, double *, int *, double *, int *); /*proto*/
2939 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int, int, int, __pyx_t_float_complex *, int *, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2940 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int, int, int, __pyx_t_double_complex *, int *, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2941 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int, int, float *, int *, float *, int *, float *, int *, float *, int *); /*proto*/
2942 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int, int, double *, int *, double *, int *, double *, int *, double *, int *); /*proto*/
2943 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2944 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2945 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int, int, int, float *, int *, float *, int *, float *, int *, float *, int *); /*proto*/
2946 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int, int, int, double *, int *, double *, int *, double *, int *, double *, int *); /*proto*/
2947 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int, int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *); /*proto*/
2948 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int, int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *); /*proto*/
2949 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int, int, float *, int *, float *, int *, int); /*proto*/
2950 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int, int, double *, int *, double *, int *, int); /*proto*/
2951 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int); /*proto*/
2952 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int); /*proto*/
2953 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int, int, int, float *, int *, float *, int *, int, int, float *); /*proto*/
2954 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int, int, int, double *, int *, double *, int *, int, int, double *); /*proto*/
2955 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int, int, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int, int, __pyx_t_float_complex *); /*proto*/
2956 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int, int, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int, int, __pyx_t_double_complex *); /*proto*/
2957 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int, int, float *, int *, int, float *, int *, float *, float *); /*proto*/
2958 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int, int, double *, int *, int, double *, int *, double *, double *); /*proto*/
2959 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int, int, __pyx_t_float_complex *, int *, int, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *); /*proto*/
2960 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int, int, __pyx_t_double_complex *, int *, int, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *); /*proto*/
2961 : /* #### Code section: typeinfo ### */
2962 : /* #### Code section: before_global_var ### */
2963 : #define __Pyx_MODULE_NAME "scipy.linalg._decomp_update"
2964 : extern int __pyx_module_is_main_scipy__linalg___decomp_update;
2965 : int __pyx_module_is_main_scipy__linalg___decomp_update = 0;
2966 :
2967 : /* Implementation of "scipy.linalg._decomp_update" */
2968 : /* #### Code section: global_var ### */
2969 : static PyObject *__pyx_builtin_range;
2970 : static PyObject *__pyx_builtin_ValueError;
2971 : static PyObject *__pyx_builtin_MemoryError;
2972 : static PyObject *__pyx_builtin_ImportError;
2973 : /* #### Code section: string_decls ### */
2974 : static const char __pyx_k_F[] = "F";
2975 : static const char __pyx_k_Q[] = "Q";
2976 : static const char __pyx_k_R[] = "R";
2977 : static const char __pyx_k_T[] = "T";
2978 : static const char __pyx_k_a[] = "a";
2979 : static const char __pyx_k_b[] = "b";
2980 : static const char __pyx_k_k[] = "k";
2981 : static const char __pyx_k_m[] = "m";
2982 : static const char __pyx_k_n[] = "n";
2983 : static const char __pyx_k_o[] = "o";
2984 : static const char __pyx_k_p[] = "p";
2985 : static const char __pyx_k_q[] = "q";
2986 : static const char __pyx_k_s[] = "s";
2987 : static const char __pyx_k_u[] = "u";
2988 : static const char __pyx_k_v[] = "v";
2989 : static const char __pyx_k_k1[] = "k1";
2990 : static const char __pyx_k_np[] = "np";
2991 : static const char __pyx_k_p1[] = "p1";
2992 : static const char __pyx_k_q1[] = "q1";
2993 : static const char __pyx_k_qs[] = "qs";
2994 : static const char __pyx_k_r1[] = "r1";
2995 : static const char __pyx_k_rs[] = "rs";
2996 : static const char __pyx_k_ss[] = "ss";
2997 : static const char __pyx_k_u1[] = "u1";
2998 : static const char __pyx_k_us[] = "us";
2999 : static const char __pyx_k_v1[] = "v1";
3000 : static const char __pyx_k_vs[] = "vs";
3001 : static const char __pyx_k__13[] = " ";
3002 : static const char __pyx_k__35[] = ".";
3003 : static const char __pyx_k__36[] = "*";
3004 : static const char __pyx_k__47[] = "?";
3005 : static const char __pyx_k_all[] = "all";
3006 : static const char __pyx_k_col[] = "col";
3007 : static const char __pyx_k_dot[] = "dot";
3008 : static const char __pyx_k_qTu[] = "qTu";
3009 : static const char __pyx_k_row[] = "row";
3010 : static const char __pyx_k_conj[] = "conj";
3011 : static const char __pyx_k_copy[] = "copy";
3012 : static const char __pyx_k_full[] = "full";
3013 : static const char __pyx_k_info[] = "info";
3014 : static const char __pyx_k_intp[] = "intp";
3015 : static const char __pyx_k_main[] = "__main__";
3016 : static const char __pyx_k_name[] = "__name__";
3017 : static const char __pyx_k_ndim[] = "ndim";
3018 : static const char __pyx_k_norm[] = "norm";
3019 : static const char __pyx_k_qTus[] = "qTus";
3020 : static const char __pyx_k_qisF[] = "qisF";
3021 : static const char __pyx_k_qnew[] = "qnew";
3022 : static const char __pyx_k_qptr[] = "qptr";
3023 : static const char __pyx_k_rnew[] = "rnew";
3024 : static const char __pyx_k_rptr[] = "rptr";
3025 : static const char __pyx_k_spec[] = "__spec__";
3026 : static const char __pyx_k_sptr[] = "sptr";
3027 : static const char __pyx_k_test[] = "__test__";
3028 : static const char __pyx_k_uptr[] = "uptr";
3029 : static const char __pyx_k_vptr[] = "vptr";
3030 : static const char __pyx_k_all_2[] = "__all__";
3031 : static const char __pyx_k_numpy[] = "numpy";
3032 : static const char __pyx_k_p_eco[] = "p_eco";
3033 : static const char __pyx_k_range[] = "range";
3034 : static const char __pyx_k_ravel[] = "ravel";
3035 : static const char __pyx_k_rcond[] = "rcond";
3036 : static const char __pyx_k_shape[] = "shape";
3037 : static const char __pyx_k_which[] = "which";
3038 : static const char __pyx_k_delete[] = "delete";
3039 : static const char __pyx_k_format[] = "format";
3040 : static const char __pyx_k_import[] = "__import__";
3041 : static const char __pyx_k_insert[] = "insert";
3042 : static const char __pyx_k_length[] = "length";
3043 : static const char __pyx_k_linalg[] = "linalg";
3044 : static const char __pyx_k_p_full[] = "p_full";
3045 : static const char __pyx_k_qTuptr[] = "qTuptr";
3046 : static const char __pyx_k_qTuvoid[] = "qTuvoid";
3047 : static const char __pyx_k_economic[] = "economic";
3048 : static const char __pyx_k_form_qTu[] = "_form_qTu";
3049 : static const char __pyx_k_isfinite[] = "isfinite";
3050 : static const char __pyx_k_typecode[] = "typecode";
3051 : static const char __pyx_k_uv_flags[] = "uv_flags";
3052 : static const char __pyx_k_chkfinite[] = "chkfinite";
3053 : static const char __pyx_k_conjugate[] = "conjugate";
3054 : static const char __pyx_k_overwrite[] = "overwrite";
3055 : static const char __pyx_k_qr_delete[] = "qr_delete";
3056 : static const char __pyx_k_qr_insert[] = "qr_insert";
3057 : static const char __pyx_k_qr_update[] = "qr_update";
3058 : static const char __pyx_k_ValueError[] = "ValueError";
3059 : static const char __pyx_k_ImportError[] = "ImportError";
3060 : static const char __pyx_k_LinAlgError[] = "LinAlgError";
3061 : static const char __pyx_k_MemoryError[] = "MemoryError";
3062 : static const char __pyx_k_check_finite[] = "check_finite";
3063 : static const char __pyx_k_initializing[] = "_initializing";
3064 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3065 : static const char __pyx_k_numpy_linalg[] = "numpy.linalg";
3066 : static const char __pyx_k_overwrite_qr[] = "overwrite_qr";
3067 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3068 : static const char __pyx_k_overwrite_qru[] = "overwrite_qru";
3069 : static const char __pyx_k_overwrite_qruv[] = "overwrite_qruv";
3070 : static const char __pyx_k_p_is_out_of_range[] = "'p' is out of range";
3071 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3072 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3073 : static const char __pyx_k_k_is_out_of_bounds[] = "'k' is out of bounds";
3074 : static const char __pyx_k_Q_and_R_must_be_2_D[] = "Q and R must be 2-D";
3075 : static const char __pyx_k_qr_delete_line_1444[] = "qr_delete (line 1444)";
3076 : static const char __pyx_k_qr_insert_line_1689[] = "qr_insert (line 1689)";
3077 : static const char __pyx_k_qr_update_line_2154[] = "qr_update (line 2154)";
3078 : static const char __pyx_k_Inputs_must_be_arrays[] = "Inputs must be arrays";
3079 : static const char __pyx_k_for_Q_and_R_respectively[] = " for Q and R respectively";
3080 : static const char __pyx_k_u_must_be_either_1_or_2_D[] = "'u' must be either 1- or 2-D";
3081 : static const char __pyx_k_v_must_be_either_1_or_2_D[] = "v must be either 1- or 2-D.";
3082 : static const char __pyx_k_scipy_linalg__decomp_update[] = "scipy.linalg._decomp_update";
3083 : static const char __pyx_k_u_must_be_either_1_or_2_D_2[] = "u must be either 1- or 2-D.";
3084 : static const char __pyx_k_rcond_is_unused_when_inserting[] = "'rcond' is unused when inserting rows and must be None";
3085 : static const char __pyx_k_u_must_have_the_same_type_as_Q[] = "'u' must have the same type as 'Q' and 'R'";
3086 : static const char __pyx_k_u_shape_0_must_equal_Q_shape_0[] = "u.shape[0] must equal Q.shape[0]";
3087 : static const char __pyx_k_v_shape_0_must_equal_R_shape_1[] = "v.shape[0] must equal R.shape[1]";
3088 : static const char __pyx_k_Expected_M_M_M_N_or_M_N_N_N_but[] = "Expected (M,M) (M,N) or (M,N) (N,N) but found ";
3089 : static const char __pyx_k_One_of_the_columns_of_u_lies_in[] = "One of the columns of u lies in the span of Q. Found reciprocal condition number of %s for Q augmented with u/||u||.";
3090 : static const char __pyx_k_Only_arrays_with_dtypes_float32[] = "Only arrays with dtypes float32, float64, complex64, and complex128 are supported.";
3091 : static const char __pyx_k_QR_downdate_on_row_or_column_de[] = "\n QR downdate on row or column deletions\n\n If ``A = Q R`` is the QR factorization of ``A``, return the QR\n factorization of ``A`` where ``p`` rows or columns have been removed\n starting at row or column ``k``.\n\n Parameters\n ----------\n Q : (M, M) or (M, N) array_like\n Unitary/orthogonal matrix from QR decomposition.\n R : (M, N) or (N, N) array_like\n Upper triangular matrix from QR decomposition.\n k : int\n Index of the first row or column to delete.\n p : int, optional\n Number of rows or columns to delete, defaults to 1.\n which: {'row', 'col'}, optional\n Determines if rows or columns will be deleted, defaults to 'row'\n overwrite_qr : bool, optional\n If True, consume Q and R, overwriting their contents with their\n downdated versions, and returning appropriately sized views.\n Defaults to False.\n check_finite : bool, optional\n Whether to check that the input matrix contains only finite numbers.\n Disabling may give a performance gain, but may result in problems\n (crashes, non-termination) if the inputs do contain infinities or NaNs.\n Default is True.\n\n Returns\n -------\n Q1 : ndarray\n Updated unitary/orthogonal factor\n R1 : ndarray\n Updated upper triangular factor\n\n See Also\n --------\n qr, qr_multiply, qr_insert, qr_update\n\n Notes\n -----\n This routine does not guarantee that the diagonal entries of ``R1`` are\n positive.\n\n .. versionadded:: 0.16.0\n\n References\n ----------\n .. [1] Golub, G. H. & Van Loan, C. F. Matrix Computations, 3rd Ed.\n (Johns Hopkins University Press, 1996).\n\n .. [2] Daniel, J. W., Gragg, W. B., Kaufman, L. & Stewart, G. W.\n Reorthogonalization and stable algorithms for updating the\n Gram-Schmidt QR factorization. Math. Comput. 30, 772-795 (1976).\n\n .. [3] Reichel, L. & Gragg, W. B. A""lgorithm 686: FORTRAN Subroutines for\n Updating the QR Decomposition. ACM Trans. Math. Softw. 16, 369-377\n (1990).\n\n Examples\n --------\n >>> import numpy as np\n >>> from scipy import linalg\n >>> a = np.array([[ 3., -2., -2.],\n ... [ 6., -9., -3.],\n ... [ -3., 10., 1.],\n ... [ 6., -7., 4.],\n ... [ 7., 8., -6.]])\n >>> q, r = linalg.qr(a)\n\n Given this QR decomposition, update q and r when 2 rows are removed.\n\n >>> q1, r1 = linalg.qr_delete(q, r, 2, 2, 'row', False)\n >>> q1\n array([[ 0.30942637, 0.15347579, 0.93845645], # may vary (signs)\n [ 0.61885275, 0.71680171, -0.32127338],\n [ 0.72199487, -0.68017681, -0.12681844]])\n >>> r1\n array([[ 9.69535971, -0.4125685 , -6.80738023], # may vary (signs)\n [ 0. , -12.19958144, 1.62370412],\n [ 0. , 0. , -0.15218213]])\n\n The update is equivalent, but faster than the following.\n\n >>> a1 = np.delete(a, slice(2,4), 0)\n >>> a1\n array([[ 3., -2., -2.],\n [ 6., -9., -3.],\n [ 7., 8., -6.]])\n >>> q_direct, r_direct = linalg.qr(a1)\n\n Check that we have equivalent results:\n\n >>> np.dot(q1, r1)\n array([[ 3., -2., -2.],\n [ 6., -9., -3.],\n [ 7., 8., -6.]])\n >>> np.allclose(np.dot(q1, r1), a1)\n True\n\n And the updated Q is still unitary:\n\n >>> np.allclose(np.dot(q1.T, q1), np.eye(3))\n True\n\n ";
3092 : static const char __pyx_k_QR_update_on_row_or_column_inse[] = "\n QR update on row or column insertions\n\n If ``A = Q R`` is the QR factorization of ``A``, return the QR\n factorization of ``A`` where rows or columns have been inserted starting\n at row or column ``k``.\n\n Parameters\n ----------\n Q : (M, M) array_like\n Unitary/orthogonal matrix from the QR decomposition of A.\n R : (M, N) array_like\n Upper triangular matrix from the QR decomposition of A.\n u : (N,), (p, N), (M,), or (M, p) array_like\n Rows or columns to insert\n k : int\n Index before which `u` is to be inserted.\n which: {'row', 'col'}, optional\n Determines if rows or columns will be inserted, defaults to 'row'\n rcond : float\n Lower bound on the reciprocal condition number of ``Q`` augmented with\n ``u/||u||`` Only used when updating economic mode (thin, (M,N) (N,N))\n decompositions. If None, machine precision is used. Defaults to\n None.\n overwrite_qru : bool, optional\n If True, consume Q, R, and u, if possible, while performing the update,\n otherwise make copies as necessary. Defaults to False.\n check_finite : bool, optional\n Whether to check that the input matrices contain only finite numbers.\n Disabling may give a performance gain, but may result in problems\n (crashes, non-termination) if the inputs do contain infinities or NaNs.\n Default is True.\n\n Returns\n -------\n Q1 : ndarray\n Updated unitary/orthogonal factor\n R1 : ndarray\n Updated upper triangular factor\n\n Raises\n ------\n LinAlgError :\n If updating a (M,N) (N,N) factorization and the reciprocal condition\n number of Q augmented with ``u/||u||`` is smaller than rcond.\n\n See Also\n --------\n qr, qr_multiply, qr_delete, qr_update\n\n Notes\n -----\n This routine does not guarantee that the diagonal entries of ``R1`` are\n positive.\n\n .. versionadded"":: 0.16.0\n\n References\n ----------\n\n .. [1] Golub, G. H. & Van Loan, C. F. Matrix Computations, 3rd Ed.\n (Johns Hopkins University Press, 1996).\n\n .. [2] Daniel, J. W., Gragg, W. B., Kaufman, L. & Stewart, G. W.\n Reorthogonalization and stable algorithms for updating the\n Gram-Schmidt QR factorization. Math. Comput. 30, 772-795 (1976).\n\n .. [3] Reichel, L. & Gragg, W. B. Algorithm 686: FORTRAN Subroutines for\n Updating the QR Decomposition. ACM Trans. Math. Softw. 16, 369-377\n (1990).\n\n Examples\n --------\n >>> import numpy as np\n >>> from scipy import linalg\n >>> a = np.array([[ 3., -2., -2.],\n ... [ 6., -7., 4.],\n ... [ 7., 8., -6.]])\n >>> q, r = linalg.qr(a)\n\n Given this QR decomposition, update q and r when 2 rows are inserted.\n\n >>> u = np.array([[ 6., -9., -3.],\n ... [ -3., 10., 1.]])\n >>> q1, r1 = linalg.qr_insert(q, r, u, 2, 'row')\n >>> q1\n array([[-0.25445668, 0.02246245, 0.18146236, -0.72798806, 0.60979671], # may vary (signs)\n [-0.50891336, 0.23226178, -0.82836478, -0.02837033, -0.00828114],\n [-0.50891336, 0.35715302, 0.38937158, 0.58110733, 0.35235345],\n [ 0.25445668, -0.52202743, -0.32165498, 0.36263239, 0.65404509],\n [-0.59373225, -0.73856549, 0.16065817, -0.0063658 , -0.27595554]])\n >>> r1\n array([[-11.78982612, 6.44623587, 3.81685018], # may vary (signs)\n [ 0. , -16.01393278, 3.72202865],\n [ 0. , 0. , -6.13010256],\n [ 0. , 0. , 0. ],\n [ 0. , 0. , 0. ]])\n\n The update is equivalent, but faster than the following.\n\n >>> a1 = np.insert(a, 2, u, 0)\n >>> a1\n array([[ 3., -2., -2.],\n [ 6., -7., 4.],\n [ 6., -9., -3.],\n "" [ -3., 10., 1.],\n [ 7., 8., -6.]])\n >>> q_direct, r_direct = linalg.qr(a1)\n\n Check that we have equivalent results:\n\n >>> np.dot(q1, r1)\n array([[ 3., -2., -2.],\n [ 6., -7., 4.],\n [ 6., -9., -3.],\n [ -3., 10., 1.],\n [ 7., 8., -6.]])\n\n >>> np.allclose(np.dot(q1, r1), a1)\n True\n\n And the updated Q is still unitary:\n\n >>> np.allclose(np.dot(q1.T, q1), np.eye(5))\n True\n\n ";
3093 : static const char __pyx_k_Rank_k_QR_update_If_A_Q_R_is_th[] = "\n Rank-k QR update\n\n If ``A = Q R`` is the QR factorization of ``A``, return the QR\n factorization of ``A + u v**T`` for real ``A`` or ``A + u v**H``\n for complex ``A``.\n\n Parameters\n ----------\n Q : (M, M) or (M, N) array_like\n Unitary/orthogonal matrix from the qr decomposition of A.\n R : (M, N) or (N, N) array_like\n Upper triangular matrix from the qr decomposition of A.\n u : (M,) or (M, k) array_like\n Left update vector\n v : (N,) or (N, k) array_like\n Right update vector\n overwrite_qruv : bool, optional\n If True, consume Q, R, u, and v, if possible, while performing the\n update, otherwise make copies as necessary. Defaults to False.\n check_finite : bool, optional\n Whether to check that the input matrix contains only finite numbers.\n Disabling may give a performance gain, but may result in problems\n (crashes, non-termination) if the inputs do contain infinities or NaNs.\n Default is True.\n\n Returns\n -------\n Q1 : ndarray\n Updated unitary/orthogonal factor\n R1 : ndarray\n Updated upper triangular factor\n\n See Also\n --------\n qr, qr_multiply, qr_delete, qr_insert\n\n Notes\n -----\n This routine does not guarantee that the diagonal entries of `R1` are\n real or positive.\n\n .. versionadded:: 0.16.0\n\n References\n ----------\n .. [1] Golub, G. H. & Van Loan, C. F. Matrix Computations, 3rd Ed.\n (Johns Hopkins University Press, 1996).\n\n .. [2] Daniel, J. W., Gragg, W. B., Kaufman, L. & Stewart, G. W.\n Reorthogonalization and stable algorithms for updating the\n Gram-Schmidt QR factorization. Math. Comput. 30, 772-795 (1976).\n\n .. [3] Reichel, L. & Gragg, W. B. Algorithm 686: FORTRAN Subroutines for\n Updating the QR Decomposition. ACM Trans. Math. Softw. 16, 369-377\n (1990).\n\n Examples\n --------\n "" >>> import numpy as np\n >>> from scipy import linalg\n >>> a = np.array([[ 3., -2., -2.],\n ... [ 6., -9., -3.],\n ... [ -3., 10., 1.],\n ... [ 6., -7., 4.],\n ... [ 7., 8., -6.]])\n >>> q, r = linalg.qr(a)\n\n Given this q, r decomposition, perform a rank 1 update.\n\n >>> u = np.array([7., -2., 4., 3., 5.])\n >>> v = np.array([1., 3., -5.])\n >>> q_up, r_up = linalg.qr_update(q, r, u, v, False)\n >>> q_up\n array([[ 0.54073807, 0.18645997, 0.81707661, -0.02136616, 0.06902409], # may vary (signs)\n [ 0.21629523, -0.63257324, 0.06567893, 0.34125904, -0.65749222],\n [ 0.05407381, 0.64757787, -0.12781284, -0.20031219, -0.72198188],\n [ 0.48666426, -0.30466718, -0.27487277, -0.77079214, 0.0256951 ],\n [ 0.64888568, 0.23001 , -0.4859845 , 0.49883891, 0.20253783]])\n >>> r_up\n array([[ 18.49324201, 24.11691794, -44.98940746], # may vary (signs)\n [ 0. , 31.95894662, -27.40998201],\n [ 0. , 0. , -9.25451794],\n [ 0. , 0. , 0. ],\n [ 0. , 0. , 0. ]])\n\n The update is equivalent, but faster than the following.\n\n >>> a_up = a + np.outer(u, v)\n >>> q_direct, r_direct = linalg.qr(a_up)\n\n Check that we have equivalent results:\n\n >>> np.allclose(np.dot(q_up, r_up), a_up)\n True\n\n And the updated Q is still unitary:\n\n >>> np.allclose(np.dot(q_up.T, q_up), np.eye(5))\n True\n\n Updating economic (reduced, thin) decompositions is also possible:\n\n >>> qe, re = linalg.qr(a, mode='economic')\n >>> qe_up, re_up = linalg.qr_update(qe, re, u, v, False)\n >>> qe_up\n array([[ 0.54073807, 0.18645997, 0.81707661], # may vary (signs)\n [ 0.21629523, -0.63257324, 0.06567893],\n [ 0.05407381, 0.64757787, -0.12781284],\n "" [ 0.48666426, -0.30466718, -0.27487277],\n [ 0.64888568, 0.23001 , -0.4859845 ]])\n >>> re_up\n array([[ 18.49324201, 24.11691794, -44.98940746], # may vary (signs)\n [ 0. , 31.95894662, -27.40998201],\n [ 0. , 0. , -9.25451794]])\n >>> np.allclose(np.dot(qe_up, re_up), a_up)\n True\n >>> np.allclose(np.dot(qe_up.T, qe_up), np.eye(3))\n True\n\n Similarly to the above, perform a rank 2 update.\n\n >>> u2 = np.array([[ 7., -1,],\n ... [-2., 4.],\n ... [ 4., 2.],\n ... [ 3., -6.],\n ... [ 5., 3.]])\n >>> v2 = np.array([[ 1., 2.],\n ... [ 3., 4.],\n ... [-5., 2]])\n >>> q_up2, r_up2 = linalg.qr_update(q, r, u2, v2, False)\n >>> q_up2\n array([[-0.33626508, -0.03477253, 0.61956287, -0.64352987, -0.29618884], # may vary (signs)\n [-0.50439762, 0.58319694, -0.43010077, -0.33395279, 0.33008064],\n [-0.21016568, -0.63123106, 0.0582249 , -0.13675572, 0.73163206],\n [ 0.12609941, 0.49694436, 0.64590024, 0.31191919, 0.47187344],\n [-0.75659643, -0.11517748, 0.10284903, 0.5986227 , -0.21299983]])\n >>> r_up2\n array([[-23.79075451, -41.1084062 , 24.71548348], # may vary (signs)\n [ 0. , -33.83931057, 11.02226551],\n [ 0. , 0. , 48.91476811],\n [ 0. , 0. , 0. ],\n [ 0. , 0. , 0. ]])\n\n This update is also a valid qr decomposition of ``A + U V**T``.\n\n >>> a_up2 = a + np.dot(u2, v2.T)\n >>> np.allclose(a_up2, np.dot(q_up2, r_up2))\n True\n >>> np.allclose(np.dot(q_up2.T, q_up2), np.eye(5))\n True\n\n ";
3094 : static const char __pyx_k_Routines_for_updating_QR_decomp[] = "\nRoutines for updating QR decompositions\n\n.. versionadded:: 0.16.0\n\n";
3095 : static const char __pyx_k_q_and_u_must_have_the_same_type[] = "q and u must have the same type.";
3096 : static const char __pyx_k_rcond_is_not_used_when_updating[] = "'rcond' is not used when updating full, (M,M) (M,N) decompositions and must be None.";
3097 : static const char __pyx_k_scipy_linalg__decomp_update_pyx[] = "scipy/linalg/_decomp_update.pyx";
3098 : static const char __pyx_k_u_and_v_must_have_the_same_type[] = "u and v must have the same type as Q and R";
3099 : static const char __pyx_k_u_should_be_either_M_or_M_p_whe[] = "'u' should be either (M,) or (M,p) when inserting columns. Found %s.";
3100 : static const char __pyx_k_u_should_be_either_N_or_p_N_whe[] = "'u' should be either (N,) or (p,N) when inserting rows. Found %s.";
3101 : static const char __pyx_k_which_must_be_either_row_or_col[] = "'which' must be either 'row' or 'col'";
3102 : static const char __pyx_k_Input_array_too_large_for_use_wi[] = "Input array too large for use with BLAS";
3103 : static const char __pyx_k_Q_and_R_do_not_have_compatible_s[] = "Q and R do not have compatible shapes. Expected (M,M) (M,N) or (M,N) (N,N) but found ";
3104 : static const char __pyx_k_Q_and_R_must_have_the_same_dtype[] = "Q and R must have the same dtype";
3105 : static const char __pyx_k_Reorthogonalization_Failed_unabl[] = "Reorthogonalization Failed, unable to perform row deletion.";
3106 : static const char __pyx_k_Second_dimension_of_u_and_v_must[] = "Second dimension of u and v must be the same";
3107 : static const char __pyx_k_Shape_of_u_is_incorrect_should_b[] = "Shape of u is incorrect, should be 1 <= u.ndim <= 2";
3108 : static const char __pyx_k_The_0_th_argument_to_geqrf_was_i[] = "The {0}th argument to ?geqrf was invalid";
3109 : static const char __pyx_k_The_0_th_argument_to_ormqr_unmqr[] = "The {0}th argument to ?ormqr/?unmqr was invalid";
3110 : static const char __pyx_k_Unable_to_allocate_memory_for_ar[] = "Unable to allocate memory for array.";
3111 : static const char __pyx_k_Update_rank_larger_than_np_dot_Q[] = "Update rank larger than np.dot(Q, R).";
3112 : static const char __pyx_k_array_must_not_contain_infs_or_N[] = "array must not contain infs or NaNs";
3113 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3114 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3115 : static const char __pyx_k_q_and_u_must_be_a_blas_compatibl[] = "q and u must be a blas compatible type: f d F or D";
3116 : static const char __pyx_k_q_must_be_either_F_or_C_contiguo[] = "q must be either F or C contiguous";
3117 : static const char __pyx_k_u_and_v_must_have_the_same_numbe[] = "u and v must have the same number of dimensions";
3118 : static const char __pyx_k_u_must_have_the_same_type_as_Q_2[] = "'u' must have the same type as Q and R";
3119 : static const char __pyx_k_Unable_to_allocate_memory_for_ar_2[] = "Unable to allocate memory for array";
3120 : /* #### Code section: decls ### */
3121 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update__form_qTu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
3122 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update_2qr_delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_k, int __pyx_v_p, PyObject *__pyx_v_which, PyObject *__pyx_v_overwrite_qr, PyObject *__pyx_v_check_finite); /* proto */
3123 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update_4qr_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_u, PyObject *__pyx_v_k, PyObject *__pyx_v_which, PyObject *__pyx_v_rcond, PyObject *__pyx_v_overwrite_qru, PyObject *__pyx_v_check_finite); /* proto */
3124 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update_6qr_update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_u, PyObject *__pyx_v_v, PyObject *__pyx_v_overwrite_qruv, PyObject *__pyx_v_check_finite); /* proto */
3125 : /* #### Code section: late_includes ### */
3126 : /* #### Code section: module_state ### */
3127 : typedef struct {
3128 : PyObject *__pyx_d;
3129 : PyObject *__pyx_b;
3130 : PyObject *__pyx_cython_runtime;
3131 : PyObject *__pyx_empty_tuple;
3132 : PyObject *__pyx_empty_bytes;
3133 : PyObject *__pyx_empty_unicode;
3134 : #ifdef __Pyx_CyFunction_USED
3135 : PyTypeObject *__pyx_CyFunctionType;
3136 : #endif
3137 : #ifdef __Pyx_FusedFunction_USED
3138 : PyTypeObject *__pyx_FusedFunctionType;
3139 : #endif
3140 : #ifdef __Pyx_Generator_USED
3141 : PyTypeObject *__pyx_GeneratorType;
3142 : #endif
3143 : #ifdef __Pyx_IterableCoroutine_USED
3144 : PyTypeObject *__pyx_IterableCoroutineType;
3145 : #endif
3146 : #ifdef __Pyx_Coroutine_USED
3147 : PyTypeObject *__pyx_CoroutineAwaitType;
3148 : #endif
3149 : #ifdef __Pyx_Coroutine_USED
3150 : PyTypeObject *__pyx_CoroutineType;
3151 : #endif
3152 : #if CYTHON_USE_MODULE_STATE
3153 : #endif
3154 : #if CYTHON_USE_MODULE_STATE
3155 : #endif
3156 : #if CYTHON_USE_MODULE_STATE
3157 : #endif
3158 : #if CYTHON_USE_MODULE_STATE
3159 : #endif
3160 : #if CYTHON_USE_MODULE_STATE
3161 : #endif
3162 : #if CYTHON_USE_MODULE_STATE
3163 : #endif
3164 : #if CYTHON_USE_MODULE_STATE
3165 : #endif
3166 : #if CYTHON_USE_MODULE_STATE
3167 : #endif
3168 : #if CYTHON_USE_MODULE_STATE
3169 : #endif
3170 : #if CYTHON_USE_MODULE_STATE
3171 : #endif
3172 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3173 : #if CYTHON_USE_MODULE_STATE
3174 : #endif
3175 : #if CYTHON_USE_MODULE_STATE
3176 : #endif
3177 : #if CYTHON_USE_MODULE_STATE
3178 : #endif
3179 : #if CYTHON_USE_MODULE_STATE
3180 : #endif
3181 : #if CYTHON_USE_MODULE_STATE
3182 : #endif
3183 : PyTypeObject *__pyx_ptype_5numpy_dtype;
3184 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
3185 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
3186 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
3187 : PyTypeObject *__pyx_ptype_5numpy_generic;
3188 : PyTypeObject *__pyx_ptype_5numpy_number;
3189 : PyTypeObject *__pyx_ptype_5numpy_integer;
3190 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3191 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3192 : PyTypeObject *__pyx_ptype_5numpy_inexact;
3193 : PyTypeObject *__pyx_ptype_5numpy_floating;
3194 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3195 : PyTypeObject *__pyx_ptype_5numpy_flexible;
3196 : PyTypeObject *__pyx_ptype_5numpy_character;
3197 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
3198 : #if CYTHON_USE_MODULE_STATE
3199 : #endif
3200 : #if CYTHON_USE_MODULE_STATE
3201 : #endif
3202 : #if CYTHON_USE_MODULE_STATE
3203 : #endif
3204 : #if CYTHON_USE_MODULE_STATE
3205 : #endif
3206 : PyObject *__pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but;
3207 : PyObject *__pyx_n_u_F;
3208 : PyObject *__pyx_n_s_ImportError;
3209 : PyObject *__pyx_kp_u_Input_array_too_large_for_use_wi;
3210 : PyObject *__pyx_kp_u_Inputs_must_be_arrays;
3211 : PyObject *__pyx_n_s_LinAlgError;
3212 : PyObject *__pyx_n_s_MemoryError;
3213 : PyObject *__pyx_kp_u_One_of_the_columns_of_u_lies_in;
3214 : PyObject *__pyx_kp_u_Only_arrays_with_dtypes_float32;
3215 : PyObject *__pyx_n_s_Q;
3216 : PyObject *__pyx_kp_u_QR_downdate_on_row_or_column_de;
3217 : PyObject *__pyx_kp_u_QR_update_on_row_or_column_inse;
3218 : PyObject *__pyx_kp_u_Q_and_R_do_not_have_compatible_s;
3219 : PyObject *__pyx_kp_u_Q_and_R_must_be_2_D;
3220 : PyObject *__pyx_kp_u_Q_and_R_must_have_the_same_dtype;
3221 : PyObject *__pyx_n_s_R;
3222 : PyObject *__pyx_kp_u_Rank_k_QR_update_If_A_Q_R_is_th;
3223 : PyObject *__pyx_kp_u_Reorthogonalization_Failed_unabl;
3224 : PyObject *__pyx_kp_u_Second_dimension_of_u_and_v_must;
3225 : PyObject *__pyx_kp_u_Shape_of_u_is_incorrect_should_b;
3226 : PyObject *__pyx_n_s_T;
3227 : PyObject *__pyx_kp_u_The_0_th_argument_to_geqrf_was_i;
3228 : PyObject *__pyx_kp_u_The_0_th_argument_to_ormqr_unmqr;
3229 : PyObject *__pyx_kp_u_Unable_to_allocate_memory_for_ar;
3230 : PyObject *__pyx_kp_u_Unable_to_allocate_memory_for_ar_2;
3231 : PyObject *__pyx_kp_u_Update_rank_larger_than_np_dot_Q;
3232 : PyObject *__pyx_n_s_ValueError;
3233 : PyObject *__pyx_kp_u__13;
3234 : PyObject *__pyx_kp_u__35;
3235 : PyObject *__pyx_n_s__36;
3236 : PyObject *__pyx_n_s__47;
3237 : PyObject *__pyx_n_s_a;
3238 : PyObject *__pyx_n_s_all;
3239 : PyObject *__pyx_n_s_all_2;
3240 : PyObject *__pyx_kp_u_array_must_not_contain_infs_or_N;
3241 : PyObject *__pyx_n_s_asyncio_coroutines;
3242 : PyObject *__pyx_n_s_b;
3243 : PyObject *__pyx_n_s_check_finite;
3244 : PyObject *__pyx_n_s_chkfinite;
3245 : PyObject *__pyx_n_s_class_getitem;
3246 : PyObject *__pyx_n_s_cline_in_traceback;
3247 : PyObject *__pyx_n_u_col;
3248 : PyObject *__pyx_n_s_conj;
3249 : PyObject *__pyx_n_s_conjugate;
3250 : PyObject *__pyx_n_s_copy;
3251 : PyObject *__pyx_n_s_delete;
3252 : PyObject *__pyx_n_s_dot;
3253 : PyObject *__pyx_n_s_economic;
3254 : PyObject *__pyx_kp_u_for_Q_and_R_respectively;
3255 : PyObject *__pyx_n_s_form_qTu;
3256 : PyObject *__pyx_n_s_format;
3257 : PyObject *__pyx_n_s_full;
3258 : PyObject *__pyx_n_s_import;
3259 : PyObject *__pyx_n_s_info;
3260 : PyObject *__pyx_n_s_initializing;
3261 : PyObject *__pyx_n_s_insert;
3262 : PyObject *__pyx_n_s_intp;
3263 : PyObject *__pyx_n_s_is_coroutine;
3264 : PyObject *__pyx_n_s_isfinite;
3265 : PyObject *__pyx_n_s_k;
3266 : PyObject *__pyx_n_s_k1;
3267 : PyObject *__pyx_kp_u_k_is_out_of_bounds;
3268 : PyObject *__pyx_n_s_length;
3269 : PyObject *__pyx_n_s_linalg;
3270 : PyObject *__pyx_n_s_m;
3271 : PyObject *__pyx_n_s_main;
3272 : PyObject *__pyx_n_s_n;
3273 : PyObject *__pyx_n_s_name;
3274 : PyObject *__pyx_n_s_ndim;
3275 : PyObject *__pyx_n_s_norm;
3276 : PyObject *__pyx_n_s_np;
3277 : PyObject *__pyx_n_s_numpy;
3278 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
3279 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
3280 : PyObject *__pyx_n_s_numpy_linalg;
3281 : PyObject *__pyx_n_s_o;
3282 : PyObject *__pyx_n_s_overwrite;
3283 : PyObject *__pyx_n_s_overwrite_qr;
3284 : PyObject *__pyx_n_s_overwrite_qru;
3285 : PyObject *__pyx_n_s_overwrite_qruv;
3286 : PyObject *__pyx_n_s_p;
3287 : PyObject *__pyx_n_s_p1;
3288 : PyObject *__pyx_n_s_p_eco;
3289 : PyObject *__pyx_n_s_p_full;
3290 : PyObject *__pyx_kp_u_p_is_out_of_range;
3291 : PyObject *__pyx_n_s_q;
3292 : PyObject *__pyx_n_s_q1;
3293 : PyObject *__pyx_n_s_qTu;
3294 : PyObject *__pyx_n_s_qTuptr;
3295 : PyObject *__pyx_n_s_qTus;
3296 : PyObject *__pyx_n_s_qTuvoid;
3297 : PyObject *__pyx_kp_u_q_and_u_must_be_a_blas_compatibl;
3298 : PyObject *__pyx_kp_u_q_and_u_must_have_the_same_type;
3299 : PyObject *__pyx_kp_u_q_must_be_either_F_or_C_contiguo;
3300 : PyObject *__pyx_n_s_qisF;
3301 : PyObject *__pyx_n_s_qnew;
3302 : PyObject *__pyx_n_s_qptr;
3303 : PyObject *__pyx_n_s_qr_delete;
3304 : PyObject *__pyx_n_u_qr_delete;
3305 : PyObject *__pyx_kp_u_qr_delete_line_1444;
3306 : PyObject *__pyx_n_s_qr_insert;
3307 : PyObject *__pyx_n_u_qr_insert;
3308 : PyObject *__pyx_kp_u_qr_insert_line_1689;
3309 : PyObject *__pyx_n_s_qr_update;
3310 : PyObject *__pyx_n_u_qr_update;
3311 : PyObject *__pyx_kp_u_qr_update_line_2154;
3312 : PyObject *__pyx_n_s_qs;
3313 : PyObject *__pyx_n_s_r1;
3314 : PyObject *__pyx_n_s_range;
3315 : PyObject *__pyx_n_s_ravel;
3316 : PyObject *__pyx_n_s_rcond;
3317 : PyObject *__pyx_kp_u_rcond_is_not_used_when_updating;
3318 : PyObject *__pyx_kp_u_rcond_is_unused_when_inserting;
3319 : PyObject *__pyx_n_s_rnew;
3320 : PyObject *__pyx_n_u_row;
3321 : PyObject *__pyx_n_s_rptr;
3322 : PyObject *__pyx_n_s_rs;
3323 : PyObject *__pyx_n_s_s;
3324 : PyObject *__pyx_n_s_scipy_linalg__decomp_update;
3325 : PyObject *__pyx_kp_s_scipy_linalg__decomp_update_pyx;
3326 : PyObject *__pyx_n_u_shape;
3327 : PyObject *__pyx_n_s_spec;
3328 : PyObject *__pyx_n_s_sptr;
3329 : PyObject *__pyx_n_s_ss;
3330 : PyObject *__pyx_n_s_test;
3331 : PyObject *__pyx_n_s_typecode;
3332 : PyObject *__pyx_n_s_u;
3333 : PyObject *__pyx_n_s_u1;
3334 : PyObject *__pyx_kp_u_u_and_v_must_have_the_same_numbe;
3335 : PyObject *__pyx_kp_u_u_and_v_must_have_the_same_type;
3336 : PyObject *__pyx_kp_u_u_must_be_either_1_or_2_D;
3337 : PyObject *__pyx_kp_u_u_must_be_either_1_or_2_D_2;
3338 : PyObject *__pyx_kp_u_u_must_have_the_same_type_as_Q;
3339 : PyObject *__pyx_kp_u_u_must_have_the_same_type_as_Q_2;
3340 : PyObject *__pyx_kp_u_u_shape_0_must_equal_Q_shape_0;
3341 : PyObject *__pyx_kp_u_u_should_be_either_M_or_M_p_whe;
3342 : PyObject *__pyx_kp_u_u_should_be_either_N_or_p_N_whe;
3343 : PyObject *__pyx_n_s_uptr;
3344 : PyObject *__pyx_n_s_us;
3345 : PyObject *__pyx_n_s_uv_flags;
3346 : PyObject *__pyx_n_s_v;
3347 : PyObject *__pyx_n_s_v1;
3348 : PyObject *__pyx_kp_u_v_must_be_either_1_or_2_D;
3349 : PyObject *__pyx_kp_u_v_shape_0_must_equal_R_shape_1;
3350 : PyObject *__pyx_n_s_vptr;
3351 : PyObject *__pyx_n_s_vs;
3352 : PyObject *__pyx_n_s_which;
3353 : PyObject *__pyx_kp_u_which_must_be_either_row_or_col;
3354 : PyObject *__pyx_int_0;
3355 : PyObject *__pyx_int_1;
3356 : PyObject *__pyx_tuple_;
3357 : PyObject *__pyx_tuple__2;
3358 : PyObject *__pyx_tuple__3;
3359 : PyObject *__pyx_tuple__4;
3360 : PyObject *__pyx_tuple__5;
3361 : PyObject *__pyx_tuple__6;
3362 : PyObject *__pyx_tuple__7;
3363 : PyObject *__pyx_tuple__8;
3364 : PyObject *__pyx_tuple__9;
3365 : PyObject *__pyx_slice__16;
3366 : PyObject *__pyx_tuple__10;
3367 : PyObject *__pyx_tuple__11;
3368 : PyObject *__pyx_tuple__12;
3369 : PyObject *__pyx_tuple__14;
3370 : PyObject *__pyx_tuple__15;
3371 : PyObject *__pyx_tuple__17;
3372 : PyObject *__pyx_tuple__18;
3373 : PyObject *__pyx_tuple__19;
3374 : PyObject *__pyx_tuple__20;
3375 : PyObject *__pyx_tuple__21;
3376 : PyObject *__pyx_tuple__22;
3377 : PyObject *__pyx_tuple__23;
3378 : PyObject *__pyx_tuple__24;
3379 : PyObject *__pyx_tuple__25;
3380 : PyObject *__pyx_tuple__26;
3381 : PyObject *__pyx_tuple__27;
3382 : PyObject *__pyx_tuple__28;
3383 : PyObject *__pyx_tuple__29;
3384 : PyObject *__pyx_tuple__30;
3385 : PyObject *__pyx_tuple__31;
3386 : PyObject *__pyx_tuple__32;
3387 : PyObject *__pyx_tuple__33;
3388 : PyObject *__pyx_tuple__34;
3389 : PyObject *__pyx_tuple__37;
3390 : PyObject *__pyx_tuple__39;
3391 : PyObject *__pyx_tuple__41;
3392 : PyObject *__pyx_tuple__43;
3393 : PyObject *__pyx_tuple__44;
3394 : PyObject *__pyx_tuple__46;
3395 : PyObject *__pyx_codeobj__38;
3396 : PyObject *__pyx_codeobj__40;
3397 : PyObject *__pyx_codeobj__42;
3398 : PyObject *__pyx_codeobj__45;
3399 : } __pyx_mstate;
3400 :
3401 : #if CYTHON_USE_MODULE_STATE
3402 : #ifdef __cplusplus
3403 : namespace {
3404 : extern struct PyModuleDef __pyx_moduledef;
3405 : } /* anonymous namespace */
3406 : #else
3407 : static struct PyModuleDef __pyx_moduledef;
3408 : #endif
3409 :
3410 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
3411 :
3412 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
3413 :
3414 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
3415 : #else
3416 : static __pyx_mstate __pyx_mstate_global_static =
3417 : #ifdef __cplusplus
3418 : {};
3419 : #else
3420 : {0};
3421 : #endif
3422 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
3423 : #endif
3424 : /* #### Code section: module_state_clear ### */
3425 : #if CYTHON_USE_MODULE_STATE
3426 : static int __pyx_m_clear(PyObject *m) {
3427 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
3428 : if (!clear_module_state) return 0;
3429 : Py_CLEAR(clear_module_state->__pyx_d);
3430 : Py_CLEAR(clear_module_state->__pyx_b);
3431 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3432 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3433 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3434 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3435 : #ifdef __Pyx_CyFunction_USED
3436 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3437 : #endif
3438 : #ifdef __Pyx_FusedFunction_USED
3439 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
3440 : #endif
3441 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3442 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3443 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3444 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3445 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3446 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3447 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3448 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3449 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3450 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3451 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3452 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3453 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3454 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3455 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3456 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3457 : Py_CLEAR(clear_module_state->__pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but);
3458 : Py_CLEAR(clear_module_state->__pyx_n_u_F);
3459 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
3460 : Py_CLEAR(clear_module_state->__pyx_kp_u_Input_array_too_large_for_use_wi);
3461 : Py_CLEAR(clear_module_state->__pyx_kp_u_Inputs_must_be_arrays);
3462 : Py_CLEAR(clear_module_state->__pyx_n_s_LinAlgError);
3463 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
3464 : Py_CLEAR(clear_module_state->__pyx_kp_u_One_of_the_columns_of_u_lies_in);
3465 : Py_CLEAR(clear_module_state->__pyx_kp_u_Only_arrays_with_dtypes_float32);
3466 : Py_CLEAR(clear_module_state->__pyx_n_s_Q);
3467 : Py_CLEAR(clear_module_state->__pyx_kp_u_QR_downdate_on_row_or_column_de);
3468 : Py_CLEAR(clear_module_state->__pyx_kp_u_QR_update_on_row_or_column_inse);
3469 : Py_CLEAR(clear_module_state->__pyx_kp_u_Q_and_R_do_not_have_compatible_s);
3470 : Py_CLEAR(clear_module_state->__pyx_kp_u_Q_and_R_must_be_2_D);
3471 : Py_CLEAR(clear_module_state->__pyx_kp_u_Q_and_R_must_have_the_same_dtype);
3472 : Py_CLEAR(clear_module_state->__pyx_n_s_R);
3473 : Py_CLEAR(clear_module_state->__pyx_kp_u_Rank_k_QR_update_If_A_Q_R_is_th);
3474 : Py_CLEAR(clear_module_state->__pyx_kp_u_Reorthogonalization_Failed_unabl);
3475 : Py_CLEAR(clear_module_state->__pyx_kp_u_Second_dimension_of_u_and_v_must);
3476 : Py_CLEAR(clear_module_state->__pyx_kp_u_Shape_of_u_is_incorrect_should_b);
3477 : Py_CLEAR(clear_module_state->__pyx_n_s_T);
3478 : Py_CLEAR(clear_module_state->__pyx_kp_u_The_0_th_argument_to_geqrf_was_i);
3479 : Py_CLEAR(clear_module_state->__pyx_kp_u_The_0_th_argument_to_ormqr_unmqr);
3480 : Py_CLEAR(clear_module_state->__pyx_kp_u_Unable_to_allocate_memory_for_ar);
3481 : Py_CLEAR(clear_module_state->__pyx_kp_u_Unable_to_allocate_memory_for_ar_2);
3482 : Py_CLEAR(clear_module_state->__pyx_kp_u_Update_rank_larger_than_np_dot_Q);
3483 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
3484 : Py_CLEAR(clear_module_state->__pyx_kp_u__13);
3485 : Py_CLEAR(clear_module_state->__pyx_kp_u__35);
3486 : Py_CLEAR(clear_module_state->__pyx_n_s__36);
3487 : Py_CLEAR(clear_module_state->__pyx_n_s__47);
3488 : Py_CLEAR(clear_module_state->__pyx_n_s_a);
3489 : Py_CLEAR(clear_module_state->__pyx_n_s_all);
3490 : Py_CLEAR(clear_module_state->__pyx_n_s_all_2);
3491 : Py_CLEAR(clear_module_state->__pyx_kp_u_array_must_not_contain_infs_or_N);
3492 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
3493 : Py_CLEAR(clear_module_state->__pyx_n_s_b);
3494 : Py_CLEAR(clear_module_state->__pyx_n_s_check_finite);
3495 : Py_CLEAR(clear_module_state->__pyx_n_s_chkfinite);
3496 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
3497 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
3498 : Py_CLEAR(clear_module_state->__pyx_n_u_col);
3499 : Py_CLEAR(clear_module_state->__pyx_n_s_conj);
3500 : Py_CLEAR(clear_module_state->__pyx_n_s_conjugate);
3501 : Py_CLEAR(clear_module_state->__pyx_n_s_copy);
3502 : Py_CLEAR(clear_module_state->__pyx_n_s_delete);
3503 : Py_CLEAR(clear_module_state->__pyx_n_s_dot);
3504 : Py_CLEAR(clear_module_state->__pyx_n_s_economic);
3505 : Py_CLEAR(clear_module_state->__pyx_kp_u_for_Q_and_R_respectively);
3506 : Py_CLEAR(clear_module_state->__pyx_n_s_form_qTu);
3507 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
3508 : Py_CLEAR(clear_module_state->__pyx_n_s_full);
3509 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
3510 : Py_CLEAR(clear_module_state->__pyx_n_s_info);
3511 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
3512 : Py_CLEAR(clear_module_state->__pyx_n_s_insert);
3513 : Py_CLEAR(clear_module_state->__pyx_n_s_intp);
3514 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
3515 : Py_CLEAR(clear_module_state->__pyx_n_s_isfinite);
3516 : Py_CLEAR(clear_module_state->__pyx_n_s_k);
3517 : Py_CLEAR(clear_module_state->__pyx_n_s_k1);
3518 : Py_CLEAR(clear_module_state->__pyx_kp_u_k_is_out_of_bounds);
3519 : Py_CLEAR(clear_module_state->__pyx_n_s_length);
3520 : Py_CLEAR(clear_module_state->__pyx_n_s_linalg);
3521 : Py_CLEAR(clear_module_state->__pyx_n_s_m);
3522 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
3523 : Py_CLEAR(clear_module_state->__pyx_n_s_n);
3524 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
3525 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
3526 : Py_CLEAR(clear_module_state->__pyx_n_s_norm);
3527 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
3528 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
3529 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
3530 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
3531 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy_linalg);
3532 : Py_CLEAR(clear_module_state->__pyx_n_s_o);
3533 : Py_CLEAR(clear_module_state->__pyx_n_s_overwrite);
3534 : Py_CLEAR(clear_module_state->__pyx_n_s_overwrite_qr);
3535 : Py_CLEAR(clear_module_state->__pyx_n_s_overwrite_qru);
3536 : Py_CLEAR(clear_module_state->__pyx_n_s_overwrite_qruv);
3537 : Py_CLEAR(clear_module_state->__pyx_n_s_p);
3538 : Py_CLEAR(clear_module_state->__pyx_n_s_p1);
3539 : Py_CLEAR(clear_module_state->__pyx_n_s_p_eco);
3540 : Py_CLEAR(clear_module_state->__pyx_n_s_p_full);
3541 : Py_CLEAR(clear_module_state->__pyx_kp_u_p_is_out_of_range);
3542 : Py_CLEAR(clear_module_state->__pyx_n_s_q);
3543 : Py_CLEAR(clear_module_state->__pyx_n_s_q1);
3544 : Py_CLEAR(clear_module_state->__pyx_n_s_qTu);
3545 : Py_CLEAR(clear_module_state->__pyx_n_s_qTuptr);
3546 : Py_CLEAR(clear_module_state->__pyx_n_s_qTus);
3547 : Py_CLEAR(clear_module_state->__pyx_n_s_qTuvoid);
3548 : Py_CLEAR(clear_module_state->__pyx_kp_u_q_and_u_must_be_a_blas_compatibl);
3549 : Py_CLEAR(clear_module_state->__pyx_kp_u_q_and_u_must_have_the_same_type);
3550 : Py_CLEAR(clear_module_state->__pyx_kp_u_q_must_be_either_F_or_C_contiguo);
3551 : Py_CLEAR(clear_module_state->__pyx_n_s_qisF);
3552 : Py_CLEAR(clear_module_state->__pyx_n_s_qnew);
3553 : Py_CLEAR(clear_module_state->__pyx_n_s_qptr);
3554 : Py_CLEAR(clear_module_state->__pyx_n_s_qr_delete);
3555 : Py_CLEAR(clear_module_state->__pyx_n_u_qr_delete);
3556 : Py_CLEAR(clear_module_state->__pyx_kp_u_qr_delete_line_1444);
3557 : Py_CLEAR(clear_module_state->__pyx_n_s_qr_insert);
3558 : Py_CLEAR(clear_module_state->__pyx_n_u_qr_insert);
3559 : Py_CLEAR(clear_module_state->__pyx_kp_u_qr_insert_line_1689);
3560 : Py_CLEAR(clear_module_state->__pyx_n_s_qr_update);
3561 : Py_CLEAR(clear_module_state->__pyx_n_u_qr_update);
3562 : Py_CLEAR(clear_module_state->__pyx_kp_u_qr_update_line_2154);
3563 : Py_CLEAR(clear_module_state->__pyx_n_s_qs);
3564 : Py_CLEAR(clear_module_state->__pyx_n_s_r1);
3565 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
3566 : Py_CLEAR(clear_module_state->__pyx_n_s_ravel);
3567 : Py_CLEAR(clear_module_state->__pyx_n_s_rcond);
3568 : Py_CLEAR(clear_module_state->__pyx_kp_u_rcond_is_not_used_when_updating);
3569 : Py_CLEAR(clear_module_state->__pyx_kp_u_rcond_is_unused_when_inserting);
3570 : Py_CLEAR(clear_module_state->__pyx_n_s_rnew);
3571 : Py_CLEAR(clear_module_state->__pyx_n_u_row);
3572 : Py_CLEAR(clear_module_state->__pyx_n_s_rptr);
3573 : Py_CLEAR(clear_module_state->__pyx_n_s_rs);
3574 : Py_CLEAR(clear_module_state->__pyx_n_s_s);
3575 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_linalg__decomp_update);
3576 : Py_CLEAR(clear_module_state->__pyx_kp_s_scipy_linalg__decomp_update_pyx);
3577 : Py_CLEAR(clear_module_state->__pyx_n_u_shape);
3578 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
3579 : Py_CLEAR(clear_module_state->__pyx_n_s_sptr);
3580 : Py_CLEAR(clear_module_state->__pyx_n_s_ss);
3581 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
3582 : Py_CLEAR(clear_module_state->__pyx_n_s_typecode);
3583 : Py_CLEAR(clear_module_state->__pyx_n_s_u);
3584 : Py_CLEAR(clear_module_state->__pyx_n_s_u1);
3585 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_and_v_must_have_the_same_numbe);
3586 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_and_v_must_have_the_same_type);
3587 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_must_be_either_1_or_2_D);
3588 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_must_be_either_1_or_2_D_2);
3589 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_must_have_the_same_type_as_Q);
3590 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_must_have_the_same_type_as_Q_2);
3591 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_shape_0_must_equal_Q_shape_0);
3592 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_should_be_either_M_or_M_p_whe);
3593 : Py_CLEAR(clear_module_state->__pyx_kp_u_u_should_be_either_N_or_p_N_whe);
3594 : Py_CLEAR(clear_module_state->__pyx_n_s_uptr);
3595 : Py_CLEAR(clear_module_state->__pyx_n_s_us);
3596 : Py_CLEAR(clear_module_state->__pyx_n_s_uv_flags);
3597 : Py_CLEAR(clear_module_state->__pyx_n_s_v);
3598 : Py_CLEAR(clear_module_state->__pyx_n_s_v1);
3599 : Py_CLEAR(clear_module_state->__pyx_kp_u_v_must_be_either_1_or_2_D);
3600 : Py_CLEAR(clear_module_state->__pyx_kp_u_v_shape_0_must_equal_R_shape_1);
3601 : Py_CLEAR(clear_module_state->__pyx_n_s_vptr);
3602 : Py_CLEAR(clear_module_state->__pyx_n_s_vs);
3603 : Py_CLEAR(clear_module_state->__pyx_n_s_which);
3604 : Py_CLEAR(clear_module_state->__pyx_kp_u_which_must_be_either_row_or_col);
3605 : Py_CLEAR(clear_module_state->__pyx_int_0);
3606 : Py_CLEAR(clear_module_state->__pyx_int_1);
3607 : Py_CLEAR(clear_module_state->__pyx_tuple_);
3608 : Py_CLEAR(clear_module_state->__pyx_tuple__2);
3609 : Py_CLEAR(clear_module_state->__pyx_tuple__3);
3610 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
3611 : Py_CLEAR(clear_module_state->__pyx_tuple__5);
3612 : Py_CLEAR(clear_module_state->__pyx_tuple__6);
3613 : Py_CLEAR(clear_module_state->__pyx_tuple__7);
3614 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
3615 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
3616 : Py_CLEAR(clear_module_state->__pyx_slice__16);
3617 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
3618 : Py_CLEAR(clear_module_state->__pyx_tuple__11);
3619 : Py_CLEAR(clear_module_state->__pyx_tuple__12);
3620 : Py_CLEAR(clear_module_state->__pyx_tuple__14);
3621 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
3622 : Py_CLEAR(clear_module_state->__pyx_tuple__17);
3623 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
3624 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
3625 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
3626 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
3627 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
3628 : Py_CLEAR(clear_module_state->__pyx_tuple__23);
3629 : Py_CLEAR(clear_module_state->__pyx_tuple__24);
3630 : Py_CLEAR(clear_module_state->__pyx_tuple__25);
3631 : Py_CLEAR(clear_module_state->__pyx_tuple__26);
3632 : Py_CLEAR(clear_module_state->__pyx_tuple__27);
3633 : Py_CLEAR(clear_module_state->__pyx_tuple__28);
3634 : Py_CLEAR(clear_module_state->__pyx_tuple__29);
3635 : Py_CLEAR(clear_module_state->__pyx_tuple__30);
3636 : Py_CLEAR(clear_module_state->__pyx_tuple__31);
3637 : Py_CLEAR(clear_module_state->__pyx_tuple__32);
3638 : Py_CLEAR(clear_module_state->__pyx_tuple__33);
3639 : Py_CLEAR(clear_module_state->__pyx_tuple__34);
3640 : Py_CLEAR(clear_module_state->__pyx_tuple__37);
3641 : Py_CLEAR(clear_module_state->__pyx_tuple__39);
3642 : Py_CLEAR(clear_module_state->__pyx_tuple__41);
3643 : Py_CLEAR(clear_module_state->__pyx_tuple__43);
3644 : Py_CLEAR(clear_module_state->__pyx_tuple__44);
3645 : Py_CLEAR(clear_module_state->__pyx_tuple__46);
3646 : Py_CLEAR(clear_module_state->__pyx_codeobj__38);
3647 : Py_CLEAR(clear_module_state->__pyx_codeobj__40);
3648 : Py_CLEAR(clear_module_state->__pyx_codeobj__42);
3649 : Py_CLEAR(clear_module_state->__pyx_codeobj__45);
3650 : return 0;
3651 : }
3652 : #endif
3653 : /* #### Code section: module_state_traverse ### */
3654 : #if CYTHON_USE_MODULE_STATE
3655 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
3656 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
3657 : if (!traverse_module_state) return 0;
3658 : Py_VISIT(traverse_module_state->__pyx_d);
3659 : Py_VISIT(traverse_module_state->__pyx_b);
3660 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3661 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
3662 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
3663 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
3664 : #ifdef __Pyx_CyFunction_USED
3665 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3666 : #endif
3667 : #ifdef __Pyx_FusedFunction_USED
3668 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
3669 : #endif
3670 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3671 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3672 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3673 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3674 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3675 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3676 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3677 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3678 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3679 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3680 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3681 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3682 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3683 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3684 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3685 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3686 : Py_VISIT(traverse_module_state->__pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but);
3687 : Py_VISIT(traverse_module_state->__pyx_n_u_F);
3688 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
3689 : Py_VISIT(traverse_module_state->__pyx_kp_u_Input_array_too_large_for_use_wi);
3690 : Py_VISIT(traverse_module_state->__pyx_kp_u_Inputs_must_be_arrays);
3691 : Py_VISIT(traverse_module_state->__pyx_n_s_LinAlgError);
3692 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
3693 : Py_VISIT(traverse_module_state->__pyx_kp_u_One_of_the_columns_of_u_lies_in);
3694 : Py_VISIT(traverse_module_state->__pyx_kp_u_Only_arrays_with_dtypes_float32);
3695 : Py_VISIT(traverse_module_state->__pyx_n_s_Q);
3696 : Py_VISIT(traverse_module_state->__pyx_kp_u_QR_downdate_on_row_or_column_de);
3697 : Py_VISIT(traverse_module_state->__pyx_kp_u_QR_update_on_row_or_column_inse);
3698 : Py_VISIT(traverse_module_state->__pyx_kp_u_Q_and_R_do_not_have_compatible_s);
3699 : Py_VISIT(traverse_module_state->__pyx_kp_u_Q_and_R_must_be_2_D);
3700 : Py_VISIT(traverse_module_state->__pyx_kp_u_Q_and_R_must_have_the_same_dtype);
3701 : Py_VISIT(traverse_module_state->__pyx_n_s_R);
3702 : Py_VISIT(traverse_module_state->__pyx_kp_u_Rank_k_QR_update_If_A_Q_R_is_th);
3703 : Py_VISIT(traverse_module_state->__pyx_kp_u_Reorthogonalization_Failed_unabl);
3704 : Py_VISIT(traverse_module_state->__pyx_kp_u_Second_dimension_of_u_and_v_must);
3705 : Py_VISIT(traverse_module_state->__pyx_kp_u_Shape_of_u_is_incorrect_should_b);
3706 : Py_VISIT(traverse_module_state->__pyx_n_s_T);
3707 : Py_VISIT(traverse_module_state->__pyx_kp_u_The_0_th_argument_to_geqrf_was_i);
3708 : Py_VISIT(traverse_module_state->__pyx_kp_u_The_0_th_argument_to_ormqr_unmqr);
3709 : Py_VISIT(traverse_module_state->__pyx_kp_u_Unable_to_allocate_memory_for_ar);
3710 : Py_VISIT(traverse_module_state->__pyx_kp_u_Unable_to_allocate_memory_for_ar_2);
3711 : Py_VISIT(traverse_module_state->__pyx_kp_u_Update_rank_larger_than_np_dot_Q);
3712 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
3713 : Py_VISIT(traverse_module_state->__pyx_kp_u__13);
3714 : Py_VISIT(traverse_module_state->__pyx_kp_u__35);
3715 : Py_VISIT(traverse_module_state->__pyx_n_s__36);
3716 : Py_VISIT(traverse_module_state->__pyx_n_s__47);
3717 : Py_VISIT(traverse_module_state->__pyx_n_s_a);
3718 : Py_VISIT(traverse_module_state->__pyx_n_s_all);
3719 : Py_VISIT(traverse_module_state->__pyx_n_s_all_2);
3720 : Py_VISIT(traverse_module_state->__pyx_kp_u_array_must_not_contain_infs_or_N);
3721 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
3722 : Py_VISIT(traverse_module_state->__pyx_n_s_b);
3723 : Py_VISIT(traverse_module_state->__pyx_n_s_check_finite);
3724 : Py_VISIT(traverse_module_state->__pyx_n_s_chkfinite);
3725 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
3726 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
3727 : Py_VISIT(traverse_module_state->__pyx_n_u_col);
3728 : Py_VISIT(traverse_module_state->__pyx_n_s_conj);
3729 : Py_VISIT(traverse_module_state->__pyx_n_s_conjugate);
3730 : Py_VISIT(traverse_module_state->__pyx_n_s_copy);
3731 : Py_VISIT(traverse_module_state->__pyx_n_s_delete);
3732 : Py_VISIT(traverse_module_state->__pyx_n_s_dot);
3733 : Py_VISIT(traverse_module_state->__pyx_n_s_economic);
3734 : Py_VISIT(traverse_module_state->__pyx_kp_u_for_Q_and_R_respectively);
3735 : Py_VISIT(traverse_module_state->__pyx_n_s_form_qTu);
3736 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
3737 : Py_VISIT(traverse_module_state->__pyx_n_s_full);
3738 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
3739 : Py_VISIT(traverse_module_state->__pyx_n_s_info);
3740 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
3741 : Py_VISIT(traverse_module_state->__pyx_n_s_insert);
3742 : Py_VISIT(traverse_module_state->__pyx_n_s_intp);
3743 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
3744 : Py_VISIT(traverse_module_state->__pyx_n_s_isfinite);
3745 : Py_VISIT(traverse_module_state->__pyx_n_s_k);
3746 : Py_VISIT(traverse_module_state->__pyx_n_s_k1);
3747 : Py_VISIT(traverse_module_state->__pyx_kp_u_k_is_out_of_bounds);
3748 : Py_VISIT(traverse_module_state->__pyx_n_s_length);
3749 : Py_VISIT(traverse_module_state->__pyx_n_s_linalg);
3750 : Py_VISIT(traverse_module_state->__pyx_n_s_m);
3751 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
3752 : Py_VISIT(traverse_module_state->__pyx_n_s_n);
3753 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
3754 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
3755 : Py_VISIT(traverse_module_state->__pyx_n_s_norm);
3756 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
3757 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
3758 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
3759 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
3760 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy_linalg);
3761 : Py_VISIT(traverse_module_state->__pyx_n_s_o);
3762 : Py_VISIT(traverse_module_state->__pyx_n_s_overwrite);
3763 : Py_VISIT(traverse_module_state->__pyx_n_s_overwrite_qr);
3764 : Py_VISIT(traverse_module_state->__pyx_n_s_overwrite_qru);
3765 : Py_VISIT(traverse_module_state->__pyx_n_s_overwrite_qruv);
3766 : Py_VISIT(traverse_module_state->__pyx_n_s_p);
3767 : Py_VISIT(traverse_module_state->__pyx_n_s_p1);
3768 : Py_VISIT(traverse_module_state->__pyx_n_s_p_eco);
3769 : Py_VISIT(traverse_module_state->__pyx_n_s_p_full);
3770 : Py_VISIT(traverse_module_state->__pyx_kp_u_p_is_out_of_range);
3771 : Py_VISIT(traverse_module_state->__pyx_n_s_q);
3772 : Py_VISIT(traverse_module_state->__pyx_n_s_q1);
3773 : Py_VISIT(traverse_module_state->__pyx_n_s_qTu);
3774 : Py_VISIT(traverse_module_state->__pyx_n_s_qTuptr);
3775 : Py_VISIT(traverse_module_state->__pyx_n_s_qTus);
3776 : Py_VISIT(traverse_module_state->__pyx_n_s_qTuvoid);
3777 : Py_VISIT(traverse_module_state->__pyx_kp_u_q_and_u_must_be_a_blas_compatibl);
3778 : Py_VISIT(traverse_module_state->__pyx_kp_u_q_and_u_must_have_the_same_type);
3779 : Py_VISIT(traverse_module_state->__pyx_kp_u_q_must_be_either_F_or_C_contiguo);
3780 : Py_VISIT(traverse_module_state->__pyx_n_s_qisF);
3781 : Py_VISIT(traverse_module_state->__pyx_n_s_qnew);
3782 : Py_VISIT(traverse_module_state->__pyx_n_s_qptr);
3783 : Py_VISIT(traverse_module_state->__pyx_n_s_qr_delete);
3784 : Py_VISIT(traverse_module_state->__pyx_n_u_qr_delete);
3785 : Py_VISIT(traverse_module_state->__pyx_kp_u_qr_delete_line_1444);
3786 : Py_VISIT(traverse_module_state->__pyx_n_s_qr_insert);
3787 : Py_VISIT(traverse_module_state->__pyx_n_u_qr_insert);
3788 : Py_VISIT(traverse_module_state->__pyx_kp_u_qr_insert_line_1689);
3789 : Py_VISIT(traverse_module_state->__pyx_n_s_qr_update);
3790 : Py_VISIT(traverse_module_state->__pyx_n_u_qr_update);
3791 : Py_VISIT(traverse_module_state->__pyx_kp_u_qr_update_line_2154);
3792 : Py_VISIT(traverse_module_state->__pyx_n_s_qs);
3793 : Py_VISIT(traverse_module_state->__pyx_n_s_r1);
3794 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
3795 : Py_VISIT(traverse_module_state->__pyx_n_s_ravel);
3796 : Py_VISIT(traverse_module_state->__pyx_n_s_rcond);
3797 : Py_VISIT(traverse_module_state->__pyx_kp_u_rcond_is_not_used_when_updating);
3798 : Py_VISIT(traverse_module_state->__pyx_kp_u_rcond_is_unused_when_inserting);
3799 : Py_VISIT(traverse_module_state->__pyx_n_s_rnew);
3800 : Py_VISIT(traverse_module_state->__pyx_n_u_row);
3801 : Py_VISIT(traverse_module_state->__pyx_n_s_rptr);
3802 : Py_VISIT(traverse_module_state->__pyx_n_s_rs);
3803 : Py_VISIT(traverse_module_state->__pyx_n_s_s);
3804 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_linalg__decomp_update);
3805 : Py_VISIT(traverse_module_state->__pyx_kp_s_scipy_linalg__decomp_update_pyx);
3806 : Py_VISIT(traverse_module_state->__pyx_n_u_shape);
3807 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
3808 : Py_VISIT(traverse_module_state->__pyx_n_s_sptr);
3809 : Py_VISIT(traverse_module_state->__pyx_n_s_ss);
3810 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
3811 : Py_VISIT(traverse_module_state->__pyx_n_s_typecode);
3812 : Py_VISIT(traverse_module_state->__pyx_n_s_u);
3813 : Py_VISIT(traverse_module_state->__pyx_n_s_u1);
3814 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_and_v_must_have_the_same_numbe);
3815 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_and_v_must_have_the_same_type);
3816 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_must_be_either_1_or_2_D);
3817 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_must_be_either_1_or_2_D_2);
3818 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_must_have_the_same_type_as_Q);
3819 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_must_have_the_same_type_as_Q_2);
3820 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_shape_0_must_equal_Q_shape_0);
3821 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_should_be_either_M_or_M_p_whe);
3822 : Py_VISIT(traverse_module_state->__pyx_kp_u_u_should_be_either_N_or_p_N_whe);
3823 : Py_VISIT(traverse_module_state->__pyx_n_s_uptr);
3824 : Py_VISIT(traverse_module_state->__pyx_n_s_us);
3825 : Py_VISIT(traverse_module_state->__pyx_n_s_uv_flags);
3826 : Py_VISIT(traverse_module_state->__pyx_n_s_v);
3827 : Py_VISIT(traverse_module_state->__pyx_n_s_v1);
3828 : Py_VISIT(traverse_module_state->__pyx_kp_u_v_must_be_either_1_or_2_D);
3829 : Py_VISIT(traverse_module_state->__pyx_kp_u_v_shape_0_must_equal_R_shape_1);
3830 : Py_VISIT(traverse_module_state->__pyx_n_s_vptr);
3831 : Py_VISIT(traverse_module_state->__pyx_n_s_vs);
3832 : Py_VISIT(traverse_module_state->__pyx_n_s_which);
3833 : Py_VISIT(traverse_module_state->__pyx_kp_u_which_must_be_either_row_or_col);
3834 : Py_VISIT(traverse_module_state->__pyx_int_0);
3835 : Py_VISIT(traverse_module_state->__pyx_int_1);
3836 : Py_VISIT(traverse_module_state->__pyx_tuple_);
3837 : Py_VISIT(traverse_module_state->__pyx_tuple__2);
3838 : Py_VISIT(traverse_module_state->__pyx_tuple__3);
3839 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
3840 : Py_VISIT(traverse_module_state->__pyx_tuple__5);
3841 : Py_VISIT(traverse_module_state->__pyx_tuple__6);
3842 : Py_VISIT(traverse_module_state->__pyx_tuple__7);
3843 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
3844 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
3845 : Py_VISIT(traverse_module_state->__pyx_slice__16);
3846 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
3847 : Py_VISIT(traverse_module_state->__pyx_tuple__11);
3848 : Py_VISIT(traverse_module_state->__pyx_tuple__12);
3849 : Py_VISIT(traverse_module_state->__pyx_tuple__14);
3850 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
3851 : Py_VISIT(traverse_module_state->__pyx_tuple__17);
3852 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
3853 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
3854 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
3855 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
3856 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
3857 : Py_VISIT(traverse_module_state->__pyx_tuple__23);
3858 : Py_VISIT(traverse_module_state->__pyx_tuple__24);
3859 : Py_VISIT(traverse_module_state->__pyx_tuple__25);
3860 : Py_VISIT(traverse_module_state->__pyx_tuple__26);
3861 : Py_VISIT(traverse_module_state->__pyx_tuple__27);
3862 : Py_VISIT(traverse_module_state->__pyx_tuple__28);
3863 : Py_VISIT(traverse_module_state->__pyx_tuple__29);
3864 : Py_VISIT(traverse_module_state->__pyx_tuple__30);
3865 : Py_VISIT(traverse_module_state->__pyx_tuple__31);
3866 : Py_VISIT(traverse_module_state->__pyx_tuple__32);
3867 : Py_VISIT(traverse_module_state->__pyx_tuple__33);
3868 : Py_VISIT(traverse_module_state->__pyx_tuple__34);
3869 : Py_VISIT(traverse_module_state->__pyx_tuple__37);
3870 : Py_VISIT(traverse_module_state->__pyx_tuple__39);
3871 : Py_VISIT(traverse_module_state->__pyx_tuple__41);
3872 : Py_VISIT(traverse_module_state->__pyx_tuple__43);
3873 : Py_VISIT(traverse_module_state->__pyx_tuple__44);
3874 : Py_VISIT(traverse_module_state->__pyx_tuple__46);
3875 : Py_VISIT(traverse_module_state->__pyx_codeobj__38);
3876 : Py_VISIT(traverse_module_state->__pyx_codeobj__40);
3877 : Py_VISIT(traverse_module_state->__pyx_codeobj__42);
3878 : Py_VISIT(traverse_module_state->__pyx_codeobj__45);
3879 : return 0;
3880 : }
3881 : #endif
3882 : /* #### Code section: module_state_defines ### */
3883 : #define __pyx_d __pyx_mstate_global->__pyx_d
3884 : #define __pyx_b __pyx_mstate_global->__pyx_b
3885 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
3886 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
3887 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
3888 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
3889 : #ifdef __Pyx_CyFunction_USED
3890 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
3891 : #endif
3892 : #ifdef __Pyx_FusedFunction_USED
3893 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
3894 : #endif
3895 : #ifdef __Pyx_Generator_USED
3896 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
3897 : #endif
3898 : #ifdef __Pyx_IterableCoroutine_USED
3899 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
3900 : #endif
3901 : #ifdef __Pyx_Coroutine_USED
3902 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
3903 : #endif
3904 : #ifdef __Pyx_Coroutine_USED
3905 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
3906 : #endif
3907 : #if CYTHON_USE_MODULE_STATE
3908 : #endif
3909 : #if CYTHON_USE_MODULE_STATE
3910 : #endif
3911 : #if CYTHON_USE_MODULE_STATE
3912 : #endif
3913 : #if CYTHON_USE_MODULE_STATE
3914 : #endif
3915 : #if CYTHON_USE_MODULE_STATE
3916 : #endif
3917 : #if CYTHON_USE_MODULE_STATE
3918 : #endif
3919 : #if CYTHON_USE_MODULE_STATE
3920 : #endif
3921 : #if CYTHON_USE_MODULE_STATE
3922 : #endif
3923 : #if CYTHON_USE_MODULE_STATE
3924 : #endif
3925 : #if CYTHON_USE_MODULE_STATE
3926 : #endif
3927 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
3928 : #if CYTHON_USE_MODULE_STATE
3929 : #endif
3930 : #if CYTHON_USE_MODULE_STATE
3931 : #endif
3932 : #if CYTHON_USE_MODULE_STATE
3933 : #endif
3934 : #if CYTHON_USE_MODULE_STATE
3935 : #endif
3936 : #if CYTHON_USE_MODULE_STATE
3937 : #endif
3938 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
3939 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
3940 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
3941 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
3942 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
3943 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
3944 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
3945 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
3946 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
3947 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
3948 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
3949 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
3950 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
3951 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
3952 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
3953 : #if CYTHON_USE_MODULE_STATE
3954 : #endif
3955 : #if CYTHON_USE_MODULE_STATE
3956 : #endif
3957 : #if CYTHON_USE_MODULE_STATE
3958 : #endif
3959 : #if CYTHON_USE_MODULE_STATE
3960 : #endif
3961 : #define __pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but __pyx_mstate_global->__pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but
3962 : #define __pyx_n_u_F __pyx_mstate_global->__pyx_n_u_F
3963 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
3964 : #define __pyx_kp_u_Input_array_too_large_for_use_wi __pyx_mstate_global->__pyx_kp_u_Input_array_too_large_for_use_wi
3965 : #define __pyx_kp_u_Inputs_must_be_arrays __pyx_mstate_global->__pyx_kp_u_Inputs_must_be_arrays
3966 : #define __pyx_n_s_LinAlgError __pyx_mstate_global->__pyx_n_s_LinAlgError
3967 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
3968 : #define __pyx_kp_u_One_of_the_columns_of_u_lies_in __pyx_mstate_global->__pyx_kp_u_One_of_the_columns_of_u_lies_in
3969 : #define __pyx_kp_u_Only_arrays_with_dtypes_float32 __pyx_mstate_global->__pyx_kp_u_Only_arrays_with_dtypes_float32
3970 : #define __pyx_n_s_Q __pyx_mstate_global->__pyx_n_s_Q
3971 : #define __pyx_kp_u_QR_downdate_on_row_or_column_de __pyx_mstate_global->__pyx_kp_u_QR_downdate_on_row_or_column_de
3972 : #define __pyx_kp_u_QR_update_on_row_or_column_inse __pyx_mstate_global->__pyx_kp_u_QR_update_on_row_or_column_inse
3973 : #define __pyx_kp_u_Q_and_R_do_not_have_compatible_s __pyx_mstate_global->__pyx_kp_u_Q_and_R_do_not_have_compatible_s
3974 : #define __pyx_kp_u_Q_and_R_must_be_2_D __pyx_mstate_global->__pyx_kp_u_Q_and_R_must_be_2_D
3975 : #define __pyx_kp_u_Q_and_R_must_have_the_same_dtype __pyx_mstate_global->__pyx_kp_u_Q_and_R_must_have_the_same_dtype
3976 : #define __pyx_n_s_R __pyx_mstate_global->__pyx_n_s_R
3977 : #define __pyx_kp_u_Rank_k_QR_update_If_A_Q_R_is_th __pyx_mstate_global->__pyx_kp_u_Rank_k_QR_update_If_A_Q_R_is_th
3978 : #define __pyx_kp_u_Reorthogonalization_Failed_unabl __pyx_mstate_global->__pyx_kp_u_Reorthogonalization_Failed_unabl
3979 : #define __pyx_kp_u_Second_dimension_of_u_and_v_must __pyx_mstate_global->__pyx_kp_u_Second_dimension_of_u_and_v_must
3980 : #define __pyx_kp_u_Shape_of_u_is_incorrect_should_b __pyx_mstate_global->__pyx_kp_u_Shape_of_u_is_incorrect_should_b
3981 : #define __pyx_n_s_T __pyx_mstate_global->__pyx_n_s_T
3982 : #define __pyx_kp_u_The_0_th_argument_to_geqrf_was_i __pyx_mstate_global->__pyx_kp_u_The_0_th_argument_to_geqrf_was_i
3983 : #define __pyx_kp_u_The_0_th_argument_to_ormqr_unmqr __pyx_mstate_global->__pyx_kp_u_The_0_th_argument_to_ormqr_unmqr
3984 : #define __pyx_kp_u_Unable_to_allocate_memory_for_ar __pyx_mstate_global->__pyx_kp_u_Unable_to_allocate_memory_for_ar
3985 : #define __pyx_kp_u_Unable_to_allocate_memory_for_ar_2 __pyx_mstate_global->__pyx_kp_u_Unable_to_allocate_memory_for_ar_2
3986 : #define __pyx_kp_u_Update_rank_larger_than_np_dot_Q __pyx_mstate_global->__pyx_kp_u_Update_rank_larger_than_np_dot_Q
3987 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
3988 : #define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13
3989 : #define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35
3990 : #define __pyx_n_s__36 __pyx_mstate_global->__pyx_n_s__36
3991 : #define __pyx_n_s__47 __pyx_mstate_global->__pyx_n_s__47
3992 : #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a
3993 : #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
3994 : #define __pyx_n_s_all_2 __pyx_mstate_global->__pyx_n_s_all_2
3995 : #define __pyx_kp_u_array_must_not_contain_infs_or_N __pyx_mstate_global->__pyx_kp_u_array_must_not_contain_infs_or_N
3996 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
3997 : #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b
3998 : #define __pyx_n_s_check_finite __pyx_mstate_global->__pyx_n_s_check_finite
3999 : #define __pyx_n_s_chkfinite __pyx_mstate_global->__pyx_n_s_chkfinite
4000 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
4001 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
4002 : #define __pyx_n_u_col __pyx_mstate_global->__pyx_n_u_col
4003 : #define __pyx_n_s_conj __pyx_mstate_global->__pyx_n_s_conj
4004 : #define __pyx_n_s_conjugate __pyx_mstate_global->__pyx_n_s_conjugate
4005 : #define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy
4006 : #define __pyx_n_s_delete __pyx_mstate_global->__pyx_n_s_delete
4007 : #define __pyx_n_s_dot __pyx_mstate_global->__pyx_n_s_dot
4008 : #define __pyx_n_s_economic __pyx_mstate_global->__pyx_n_s_economic
4009 : #define __pyx_kp_u_for_Q_and_R_respectively __pyx_mstate_global->__pyx_kp_u_for_Q_and_R_respectively
4010 : #define __pyx_n_s_form_qTu __pyx_mstate_global->__pyx_n_s_form_qTu
4011 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
4012 : #define __pyx_n_s_full __pyx_mstate_global->__pyx_n_s_full
4013 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
4014 : #define __pyx_n_s_info __pyx_mstate_global->__pyx_n_s_info
4015 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
4016 : #define __pyx_n_s_insert __pyx_mstate_global->__pyx_n_s_insert
4017 : #define __pyx_n_s_intp __pyx_mstate_global->__pyx_n_s_intp
4018 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
4019 : #define __pyx_n_s_isfinite __pyx_mstate_global->__pyx_n_s_isfinite
4020 : #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k
4021 : #define __pyx_n_s_k1 __pyx_mstate_global->__pyx_n_s_k1
4022 : #define __pyx_kp_u_k_is_out_of_bounds __pyx_mstate_global->__pyx_kp_u_k_is_out_of_bounds
4023 : #define __pyx_n_s_length __pyx_mstate_global->__pyx_n_s_length
4024 : #define __pyx_n_s_linalg __pyx_mstate_global->__pyx_n_s_linalg
4025 : #define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
4026 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
4027 : #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n
4028 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
4029 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
4030 : #define __pyx_n_s_norm __pyx_mstate_global->__pyx_n_s_norm
4031 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
4032 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
4033 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
4034 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
4035 : #define __pyx_n_s_numpy_linalg __pyx_mstate_global->__pyx_n_s_numpy_linalg
4036 : #define __pyx_n_s_o __pyx_mstate_global->__pyx_n_s_o
4037 : #define __pyx_n_s_overwrite __pyx_mstate_global->__pyx_n_s_overwrite
4038 : #define __pyx_n_s_overwrite_qr __pyx_mstate_global->__pyx_n_s_overwrite_qr
4039 : #define __pyx_n_s_overwrite_qru __pyx_mstate_global->__pyx_n_s_overwrite_qru
4040 : #define __pyx_n_s_overwrite_qruv __pyx_mstate_global->__pyx_n_s_overwrite_qruv
4041 : #define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p
4042 : #define __pyx_n_s_p1 __pyx_mstate_global->__pyx_n_s_p1
4043 : #define __pyx_n_s_p_eco __pyx_mstate_global->__pyx_n_s_p_eco
4044 : #define __pyx_n_s_p_full __pyx_mstate_global->__pyx_n_s_p_full
4045 : #define __pyx_kp_u_p_is_out_of_range __pyx_mstate_global->__pyx_kp_u_p_is_out_of_range
4046 : #define __pyx_n_s_q __pyx_mstate_global->__pyx_n_s_q
4047 : #define __pyx_n_s_q1 __pyx_mstate_global->__pyx_n_s_q1
4048 : #define __pyx_n_s_qTu __pyx_mstate_global->__pyx_n_s_qTu
4049 : #define __pyx_n_s_qTuptr __pyx_mstate_global->__pyx_n_s_qTuptr
4050 : #define __pyx_n_s_qTus __pyx_mstate_global->__pyx_n_s_qTus
4051 : #define __pyx_n_s_qTuvoid __pyx_mstate_global->__pyx_n_s_qTuvoid
4052 : #define __pyx_kp_u_q_and_u_must_be_a_blas_compatibl __pyx_mstate_global->__pyx_kp_u_q_and_u_must_be_a_blas_compatibl
4053 : #define __pyx_kp_u_q_and_u_must_have_the_same_type __pyx_mstate_global->__pyx_kp_u_q_and_u_must_have_the_same_type
4054 : #define __pyx_kp_u_q_must_be_either_F_or_C_contiguo __pyx_mstate_global->__pyx_kp_u_q_must_be_either_F_or_C_contiguo
4055 : #define __pyx_n_s_qisF __pyx_mstate_global->__pyx_n_s_qisF
4056 : #define __pyx_n_s_qnew __pyx_mstate_global->__pyx_n_s_qnew
4057 : #define __pyx_n_s_qptr __pyx_mstate_global->__pyx_n_s_qptr
4058 : #define __pyx_n_s_qr_delete __pyx_mstate_global->__pyx_n_s_qr_delete
4059 : #define __pyx_n_u_qr_delete __pyx_mstate_global->__pyx_n_u_qr_delete
4060 : #define __pyx_kp_u_qr_delete_line_1444 __pyx_mstate_global->__pyx_kp_u_qr_delete_line_1444
4061 : #define __pyx_n_s_qr_insert __pyx_mstate_global->__pyx_n_s_qr_insert
4062 : #define __pyx_n_u_qr_insert __pyx_mstate_global->__pyx_n_u_qr_insert
4063 : #define __pyx_kp_u_qr_insert_line_1689 __pyx_mstate_global->__pyx_kp_u_qr_insert_line_1689
4064 : #define __pyx_n_s_qr_update __pyx_mstate_global->__pyx_n_s_qr_update
4065 : #define __pyx_n_u_qr_update __pyx_mstate_global->__pyx_n_u_qr_update
4066 : #define __pyx_kp_u_qr_update_line_2154 __pyx_mstate_global->__pyx_kp_u_qr_update_line_2154
4067 : #define __pyx_n_s_qs __pyx_mstate_global->__pyx_n_s_qs
4068 : #define __pyx_n_s_r1 __pyx_mstate_global->__pyx_n_s_r1
4069 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
4070 : #define __pyx_n_s_ravel __pyx_mstate_global->__pyx_n_s_ravel
4071 : #define __pyx_n_s_rcond __pyx_mstate_global->__pyx_n_s_rcond
4072 : #define __pyx_kp_u_rcond_is_not_used_when_updating __pyx_mstate_global->__pyx_kp_u_rcond_is_not_used_when_updating
4073 : #define __pyx_kp_u_rcond_is_unused_when_inserting __pyx_mstate_global->__pyx_kp_u_rcond_is_unused_when_inserting
4074 : #define __pyx_n_s_rnew __pyx_mstate_global->__pyx_n_s_rnew
4075 : #define __pyx_n_u_row __pyx_mstate_global->__pyx_n_u_row
4076 : #define __pyx_n_s_rptr __pyx_mstate_global->__pyx_n_s_rptr
4077 : #define __pyx_n_s_rs __pyx_mstate_global->__pyx_n_s_rs
4078 : #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s
4079 : #define __pyx_n_s_scipy_linalg__decomp_update __pyx_mstate_global->__pyx_n_s_scipy_linalg__decomp_update
4080 : #define __pyx_kp_s_scipy_linalg__decomp_update_pyx __pyx_mstate_global->__pyx_kp_s_scipy_linalg__decomp_update_pyx
4081 : #define __pyx_n_u_shape __pyx_mstate_global->__pyx_n_u_shape
4082 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
4083 : #define __pyx_n_s_sptr __pyx_mstate_global->__pyx_n_s_sptr
4084 : #define __pyx_n_s_ss __pyx_mstate_global->__pyx_n_s_ss
4085 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
4086 : #define __pyx_n_s_typecode __pyx_mstate_global->__pyx_n_s_typecode
4087 : #define __pyx_n_s_u __pyx_mstate_global->__pyx_n_s_u
4088 : #define __pyx_n_s_u1 __pyx_mstate_global->__pyx_n_s_u1
4089 : #define __pyx_kp_u_u_and_v_must_have_the_same_numbe __pyx_mstate_global->__pyx_kp_u_u_and_v_must_have_the_same_numbe
4090 : #define __pyx_kp_u_u_and_v_must_have_the_same_type __pyx_mstate_global->__pyx_kp_u_u_and_v_must_have_the_same_type
4091 : #define __pyx_kp_u_u_must_be_either_1_or_2_D __pyx_mstate_global->__pyx_kp_u_u_must_be_either_1_or_2_D
4092 : #define __pyx_kp_u_u_must_be_either_1_or_2_D_2 __pyx_mstate_global->__pyx_kp_u_u_must_be_either_1_or_2_D_2
4093 : #define __pyx_kp_u_u_must_have_the_same_type_as_Q __pyx_mstate_global->__pyx_kp_u_u_must_have_the_same_type_as_Q
4094 : #define __pyx_kp_u_u_must_have_the_same_type_as_Q_2 __pyx_mstate_global->__pyx_kp_u_u_must_have_the_same_type_as_Q_2
4095 : #define __pyx_kp_u_u_shape_0_must_equal_Q_shape_0 __pyx_mstate_global->__pyx_kp_u_u_shape_0_must_equal_Q_shape_0
4096 : #define __pyx_kp_u_u_should_be_either_M_or_M_p_whe __pyx_mstate_global->__pyx_kp_u_u_should_be_either_M_or_M_p_whe
4097 : #define __pyx_kp_u_u_should_be_either_N_or_p_N_whe __pyx_mstate_global->__pyx_kp_u_u_should_be_either_N_or_p_N_whe
4098 : #define __pyx_n_s_uptr __pyx_mstate_global->__pyx_n_s_uptr
4099 : #define __pyx_n_s_us __pyx_mstate_global->__pyx_n_s_us
4100 : #define __pyx_n_s_uv_flags __pyx_mstate_global->__pyx_n_s_uv_flags
4101 : #define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v
4102 : #define __pyx_n_s_v1 __pyx_mstate_global->__pyx_n_s_v1
4103 : #define __pyx_kp_u_v_must_be_either_1_or_2_D __pyx_mstate_global->__pyx_kp_u_v_must_be_either_1_or_2_D
4104 : #define __pyx_kp_u_v_shape_0_must_equal_R_shape_1 __pyx_mstate_global->__pyx_kp_u_v_shape_0_must_equal_R_shape_1
4105 : #define __pyx_n_s_vptr __pyx_mstate_global->__pyx_n_s_vptr
4106 : #define __pyx_n_s_vs __pyx_mstate_global->__pyx_n_s_vs
4107 : #define __pyx_n_s_which __pyx_mstate_global->__pyx_n_s_which
4108 : #define __pyx_kp_u_which_must_be_either_row_or_col __pyx_mstate_global->__pyx_kp_u_which_must_be_either_row_or_col
4109 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
4110 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
4111 : #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
4112 : #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
4113 : #define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
4114 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
4115 : #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
4116 : #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
4117 : #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
4118 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
4119 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
4120 : #define __pyx_slice__16 __pyx_mstate_global->__pyx_slice__16
4121 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
4122 : #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
4123 : #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
4124 : #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
4125 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
4126 : #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
4127 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
4128 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
4129 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
4130 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
4131 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
4132 : #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
4133 : #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
4134 : #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
4135 : #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
4136 : #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
4137 : #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
4138 : #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
4139 : #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
4140 : #define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
4141 : #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
4142 : #define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33
4143 : #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
4144 : #define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37
4145 : #define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39
4146 : #define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41
4147 : #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
4148 : #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
4149 : #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
4150 : #define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38
4151 : #define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40
4152 : #define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42
4153 : #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45
4154 : /* #### Code section: module_code ### */
4155 :
4156 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
4157 : *
4158 : * @property
4159 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
4160 : * return PyDataType_ELSIZE(self)
4161 : *
4162 : */
4163 :
4164 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
4165 : npy_intp __pyx_r;
4166 :
4167 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
4168 : * @property
4169 : * cdef inline npy_intp itemsize(self) noexcept nogil:
4170 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
4171 : *
4172 : * @property
4173 : */
4174 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
4175 : goto __pyx_L0;
4176 :
4177 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
4178 : *
4179 : * @property
4180 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
4181 : * return PyDataType_ELSIZE(self)
4182 : *
4183 : */
4184 :
4185 : /* function exit code */
4186 : __pyx_L0:;
4187 : return __pyx_r;
4188 : }
4189 :
4190 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
4191 : *
4192 : * @property
4193 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
4194 : * return PyDataType_ALIGNMENT(self)
4195 : *
4196 : */
4197 :
4198 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
4199 : npy_intp __pyx_r;
4200 :
4201 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
4202 : * @property
4203 : * cdef inline npy_intp alignment(self) noexcept nogil:
4204 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
4205 : *
4206 : * # Use fields/names with care as they may be NULL. You must check
4207 : */
4208 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
4209 : goto __pyx_L0;
4210 :
4211 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
4212 : *
4213 : * @property
4214 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
4215 : * return PyDataType_ALIGNMENT(self)
4216 : *
4217 : */
4218 :
4219 : /* function exit code */
4220 : __pyx_L0:;
4221 : return __pyx_r;
4222 : }
4223 :
4224 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
4225 : * # for this using PyDataType_HASFIELDS.
4226 : * @property
4227 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
4228 : * return <object>PyDataType_FIELDS(self)
4229 : *
4230 : */
4231 :
4232 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
4233 : PyObject *__pyx_r = NULL;
4234 : __Pyx_RefNannyDeclarations
4235 : PyObject *__pyx_t_1;
4236 : __Pyx_RefNannySetupContext("fields", 1);
4237 :
4238 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
4239 : * @property
4240 : * cdef inline object fields(self):
4241 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
4242 : *
4243 : * @property
4244 : */
4245 : __Pyx_XDECREF(__pyx_r);
4246 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
4247 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
4248 : __pyx_r = ((PyObject *)__pyx_t_1);
4249 : goto __pyx_L0;
4250 :
4251 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
4252 : * # for this using PyDataType_HASFIELDS.
4253 : * @property
4254 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
4255 : * return <object>PyDataType_FIELDS(self)
4256 : *
4257 : */
4258 :
4259 : /* function exit code */
4260 : __pyx_L0:;
4261 : __Pyx_XGIVEREF(__pyx_r);
4262 : __Pyx_RefNannyFinishContext();
4263 : return __pyx_r;
4264 : }
4265 :
4266 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
4267 : *
4268 : * @property
4269 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
4270 : * return <tuple>PyDataType_NAMES(self)
4271 : *
4272 : */
4273 :
4274 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
4275 : PyObject *__pyx_r = NULL;
4276 : __Pyx_RefNannyDeclarations
4277 : PyObject *__pyx_t_1;
4278 : __Pyx_RefNannySetupContext("names", 1);
4279 :
4280 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
4281 : * @property
4282 : * cdef inline tuple names(self):
4283 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
4284 : *
4285 : * # Use PyDataType_HASSUBARRAY to test whether this field is
4286 : */
4287 : __Pyx_XDECREF(__pyx_r);
4288 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
4289 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
4290 : __pyx_r = ((PyObject*)__pyx_t_1);
4291 : goto __pyx_L0;
4292 :
4293 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
4294 : *
4295 : * @property
4296 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
4297 : * return <tuple>PyDataType_NAMES(self)
4298 : *
4299 : */
4300 :
4301 : /* function exit code */
4302 : __pyx_L0:;
4303 : __Pyx_XGIVEREF(__pyx_r);
4304 : __Pyx_RefNannyFinishContext();
4305 : return __pyx_r;
4306 : }
4307 :
4308 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
4309 : * # this field via the inline helper method PyDataType_SHAPE.
4310 : * @property
4311 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
4312 : * return PyDataType_SUBARRAY(self)
4313 : *
4314 : */
4315 :
4316 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
4317 : PyArray_ArrayDescr *__pyx_r;
4318 :
4319 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
4320 : * @property
4321 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4322 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
4323 : *
4324 : * @property
4325 : */
4326 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
4327 : goto __pyx_L0;
4328 :
4329 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
4330 : * # this field via the inline helper method PyDataType_SHAPE.
4331 : * @property
4332 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
4333 : * return PyDataType_SUBARRAY(self)
4334 : *
4335 : */
4336 :
4337 : /* function exit code */
4338 : __pyx_L0:;
4339 : return __pyx_r;
4340 : }
4341 :
4342 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
4343 : *
4344 : * @property
4345 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
4346 : * """The data types flags."""
4347 : * return PyDataType_FLAGS(self)
4348 : */
4349 :
4350 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
4351 : npy_uint64 __pyx_r;
4352 :
4353 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
4354 : * cdef inline npy_uint64 flags(self) noexcept nogil:
4355 : * """The data types flags."""
4356 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
4357 : *
4358 : *
4359 : */
4360 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
4361 : goto __pyx_L0;
4362 :
4363 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
4364 : *
4365 : * @property
4366 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
4367 : * """The data types flags."""
4368 : * return PyDataType_FLAGS(self)
4369 : */
4370 :
4371 : /* function exit code */
4372 : __pyx_L0:;
4373 : return __pyx_r;
4374 : }
4375 :
4376 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
4377 : *
4378 : * @property
4379 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
4380 : * """The number of arrays that need to be broadcast to the same shape."""
4381 : * return PyArray_MultiIter_NUMITER(self)
4382 : */
4383 :
4384 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
4385 : int __pyx_r;
4386 :
4387 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
4388 : * cdef inline int numiter(self) noexcept nogil:
4389 : * """The number of arrays that need to be broadcast to the same shape."""
4390 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
4391 : *
4392 : * @property
4393 : */
4394 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
4395 : goto __pyx_L0;
4396 :
4397 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
4398 : *
4399 : * @property
4400 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
4401 : * """The number of arrays that need to be broadcast to the same shape."""
4402 : * return PyArray_MultiIter_NUMITER(self)
4403 : */
4404 :
4405 : /* function exit code */
4406 : __pyx_L0:;
4407 : return __pyx_r;
4408 : }
4409 :
4410 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
4411 : *
4412 : * @property
4413 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
4414 : * """The total broadcasted size."""
4415 : * return PyArray_MultiIter_SIZE(self)
4416 : */
4417 :
4418 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
4419 : npy_intp __pyx_r;
4420 :
4421 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
4422 : * cdef inline npy_intp size(self) noexcept nogil:
4423 : * """The total broadcasted size."""
4424 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
4425 : *
4426 : * @property
4427 : */
4428 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
4429 : goto __pyx_L0;
4430 :
4431 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
4432 : *
4433 : * @property
4434 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
4435 : * """The total broadcasted size."""
4436 : * return PyArray_MultiIter_SIZE(self)
4437 : */
4438 :
4439 : /* function exit code */
4440 : __pyx_L0:;
4441 : return __pyx_r;
4442 : }
4443 :
4444 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
4445 : *
4446 : * @property
4447 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
4448 : * """The current (1-d) index into the broadcasted result."""
4449 : * return PyArray_MultiIter_INDEX(self)
4450 : */
4451 :
4452 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
4453 : npy_intp __pyx_r;
4454 :
4455 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
4456 : * cdef inline npy_intp index(self) noexcept nogil:
4457 : * """The current (1-d) index into the broadcasted result."""
4458 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
4459 : *
4460 : * @property
4461 : */
4462 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
4463 : goto __pyx_L0;
4464 :
4465 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
4466 : *
4467 : * @property
4468 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
4469 : * """The current (1-d) index into the broadcasted result."""
4470 : * return PyArray_MultiIter_INDEX(self)
4471 : */
4472 :
4473 : /* function exit code */
4474 : __pyx_L0:;
4475 : return __pyx_r;
4476 : }
4477 :
4478 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
4479 : *
4480 : * @property
4481 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
4482 : * """The number of dimensions in the broadcasted result."""
4483 : * return PyArray_MultiIter_NDIM(self)
4484 : */
4485 :
4486 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
4487 : int __pyx_r;
4488 :
4489 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
4490 : * cdef inline int nd(self) noexcept nogil:
4491 : * """The number of dimensions in the broadcasted result."""
4492 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
4493 : *
4494 : * @property
4495 : */
4496 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
4497 : goto __pyx_L0;
4498 :
4499 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
4500 : *
4501 : * @property
4502 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
4503 : * """The number of dimensions in the broadcasted result."""
4504 : * return PyArray_MultiIter_NDIM(self)
4505 : */
4506 :
4507 : /* function exit code */
4508 : __pyx_L0:;
4509 : return __pyx_r;
4510 : }
4511 :
4512 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
4513 : *
4514 : * @property
4515 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
4516 : * """The shape of the broadcasted result."""
4517 : * return PyArray_MultiIter_DIMS(self)
4518 : */
4519 :
4520 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
4521 : npy_intp *__pyx_r;
4522 :
4523 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
4524 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
4525 : * """The shape of the broadcasted result."""
4526 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
4527 : *
4528 : * @property
4529 : */
4530 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
4531 : goto __pyx_L0;
4532 :
4533 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
4534 : *
4535 : * @property
4536 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
4537 : * """The shape of the broadcasted result."""
4538 : * return PyArray_MultiIter_DIMS(self)
4539 : */
4540 :
4541 : /* function exit code */
4542 : __pyx_L0:;
4543 : return __pyx_r;
4544 : }
4545 :
4546 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
4547 : *
4548 : * @property
4549 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
4550 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4551 : * On return, the iterators are adjusted for broadcasting."""
4552 : */
4553 :
4554 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
4555 : void **__pyx_r;
4556 :
4557 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
4558 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4559 : * On return, the iterators are adjusted for broadcasting."""
4560 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
4561 : *
4562 : *
4563 : */
4564 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
4565 : goto __pyx_L0;
4566 :
4567 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
4568 : *
4569 : * @property
4570 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
4571 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4572 : * On return, the iterators are adjusted for broadcasting."""
4573 : */
4574 :
4575 : /* function exit code */
4576 : __pyx_L0:;
4577 : return __pyx_r;
4578 : }
4579 :
4580 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
4581 : *
4582 : * @property
4583 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
4584 : * """Returns a borrowed reference to the object owning the data/memory.
4585 : * """
4586 : */
4587 :
4588 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
4589 : PyObject *__pyx_r;
4590 :
4591 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
4592 : * """Returns a borrowed reference to the object owning the data/memory.
4593 : * """
4594 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
4595 : *
4596 : * @property
4597 : */
4598 : __pyx_r = PyArray_BASE(__pyx_v_self);
4599 : goto __pyx_L0;
4600 :
4601 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
4602 : *
4603 : * @property
4604 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
4605 : * """Returns a borrowed reference to the object owning the data/memory.
4606 : * """
4607 : */
4608 :
4609 : /* function exit code */
4610 : __pyx_L0:;
4611 : return __pyx_r;
4612 : }
4613 :
4614 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
4615 : *
4616 : * @property
4617 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
4618 : * """Returns an owned reference to the dtype of the array.
4619 : * """
4620 : */
4621 :
4622 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
4623 : PyArray_Descr *__pyx_r = NULL;
4624 : __Pyx_RefNannyDeclarations
4625 : PyArray_Descr *__pyx_t_1;
4626 : __Pyx_RefNannySetupContext("descr", 1);
4627 :
4628 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
4629 : * """Returns an owned reference to the dtype of the array.
4630 : * """
4631 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
4632 : *
4633 : * @property
4634 : */
4635 : __Pyx_XDECREF((PyObject *)__pyx_r);
4636 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
4637 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
4638 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
4639 : goto __pyx_L0;
4640 :
4641 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
4642 : *
4643 : * @property
4644 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
4645 : * """Returns an owned reference to the dtype of the array.
4646 : * """
4647 : */
4648 :
4649 : /* function exit code */
4650 : __pyx_L0:;
4651 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
4652 : __Pyx_RefNannyFinishContext();
4653 : return __pyx_r;
4654 : }
4655 :
4656 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
4657 : *
4658 : * @property
4659 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
4660 : * """Returns the number of dimensions in the array.
4661 : * """
4662 : */
4663 :
4664 328064 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
4665 328064 : int __pyx_r;
4666 :
4667 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
4668 : * """Returns the number of dimensions in the array.
4669 : * """
4670 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
4671 : *
4672 : * @property
4673 : */
4674 328064 : __pyx_r = PyArray_NDIM(__pyx_v_self);
4675 328064 : goto __pyx_L0;
4676 :
4677 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
4678 : *
4679 : * @property
4680 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
4681 : * """Returns the number of dimensions in the array.
4682 : * """
4683 : */
4684 :
4685 : /* function exit code */
4686 328064 : __pyx_L0:;
4687 1760 : return __pyx_r;
4688 : }
4689 :
4690 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
4691 : *
4692 : * @property
4693 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
4694 : * """Returns a pointer to the dimensions/shape of the array.
4695 : * The number of elements matches the number of dimensions of the array (ndim).
4696 : */
4697 :
4698 297717 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
4699 297717 : npy_intp *__pyx_r;
4700 :
4701 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
4702 : * Can return NULL for 0-dimensional arrays.
4703 : * """
4704 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
4705 : *
4706 : * @property
4707 : */
4708 297717 : __pyx_r = PyArray_DIMS(__pyx_v_self);
4709 297717 : goto __pyx_L0;
4710 :
4711 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
4712 : *
4713 : * @property
4714 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
4715 : * """Returns a pointer to the dimensions/shape of the array.
4716 : * The number of elements matches the number of dimensions of the array (ndim).
4717 : */
4718 :
4719 : /* function exit code */
4720 297717 : __pyx_L0:;
4721 2832 : return __pyx_r;
4722 : }
4723 :
4724 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
4725 : *
4726 : * @property
4727 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
4728 : * """Returns a pointer to the strides of the array.
4729 : * The number of elements matches the number of dimensions of the array (ndim).
4730 : */
4731 :
4732 411974 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
4733 411974 : npy_intp *__pyx_r;
4734 :
4735 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
4736 : * The number of elements matches the number of dimensions of the array (ndim).
4737 : * """
4738 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
4739 : *
4740 : * @property
4741 : */
4742 411974 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
4743 411974 : goto __pyx_L0;
4744 :
4745 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
4746 : *
4747 : * @property
4748 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
4749 : * """Returns a pointer to the strides of the array.
4750 : * The number of elements matches the number of dimensions of the array (ndim).
4751 : */
4752 :
4753 : /* function exit code */
4754 411974 : __pyx_L0:;
4755 91696 : return __pyx_r;
4756 : }
4757 :
4758 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
4759 : *
4760 : * @property
4761 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
4762 : * """Returns the total size (in number of elements) of the array.
4763 : * """
4764 : */
4765 :
4766 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
4767 : npy_intp __pyx_r;
4768 :
4769 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
4770 : * """Returns the total size (in number of elements) of the array.
4771 : * """
4772 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
4773 : *
4774 : * @property
4775 : */
4776 : __pyx_r = PyArray_SIZE(__pyx_v_self);
4777 : goto __pyx_L0;
4778 :
4779 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
4780 : *
4781 : * @property
4782 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
4783 : * """Returns the total size (in number of elements) of the array.
4784 : * """
4785 : */
4786 :
4787 : /* function exit code */
4788 : __pyx_L0:;
4789 : return __pyx_r;
4790 : }
4791 :
4792 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
4793 : *
4794 : * @property
4795 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
4796 : * """The pointer to the data buffer as a char*.
4797 : * This is provided for legacy reasons to avoid direct struct field access.
4798 : */
4799 :
4800 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
4801 : char *__pyx_r;
4802 :
4803 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
4804 : * of `PyArray_DATA()` instead, which returns a 'void*'.
4805 : * """
4806 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
4807 : *
4808 : *
4809 : */
4810 : __pyx_r = PyArray_BYTES(__pyx_v_self);
4811 : goto __pyx_L0;
4812 :
4813 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
4814 : *
4815 : * @property
4816 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
4817 : * """The pointer to the data buffer as a char*.
4818 : * This is provided for legacy reasons to avoid direct struct field access.
4819 : */
4820 :
4821 : /* function exit code */
4822 : __pyx_L0:;
4823 : return __pyx_r;
4824 : }
4825 :
4826 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
4827 : * ctypedef long double complex clongdouble_t
4828 : *
4829 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4830 : * return PyArray_MultiIterNew(1, <void*>a)
4831 : *
4832 : */
4833 :
4834 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4835 : PyObject *__pyx_r = NULL;
4836 : __Pyx_RefNannyDeclarations
4837 : PyObject *__pyx_t_1 = NULL;
4838 : int __pyx_lineno = 0;
4839 : const char *__pyx_filename = NULL;
4840 : int __pyx_clineno = 0;
4841 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
4842 :
4843 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
4844 : *
4845 : * cdef inline object PyArray_MultiIterNew1(a):
4846 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
4847 : *
4848 : * cdef inline object PyArray_MultiIterNew2(a, b):
4849 : */
4850 : __Pyx_XDECREF(__pyx_r);
4851 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 807, __pyx_L1_error)
4852 : __Pyx_GOTREF(__pyx_t_1);
4853 : __pyx_r = __pyx_t_1;
4854 : __pyx_t_1 = 0;
4855 : goto __pyx_L0;
4856 :
4857 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
4858 : * ctypedef long double complex clongdouble_t
4859 : *
4860 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
4861 : * return PyArray_MultiIterNew(1, <void*>a)
4862 : *
4863 : */
4864 :
4865 : /* function exit code */
4866 : __pyx_L1_error:;
4867 : __Pyx_XDECREF(__pyx_t_1);
4868 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4869 : __pyx_r = 0;
4870 : __pyx_L0:;
4871 : __Pyx_XGIVEREF(__pyx_r);
4872 : __Pyx_RefNannyFinishContext();
4873 : return __pyx_r;
4874 : }
4875 :
4876 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
4877 : * return PyArray_MultiIterNew(1, <void*>a)
4878 : *
4879 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4880 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4881 : *
4882 : */
4883 :
4884 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4885 : PyObject *__pyx_r = NULL;
4886 : __Pyx_RefNannyDeclarations
4887 : PyObject *__pyx_t_1 = NULL;
4888 : int __pyx_lineno = 0;
4889 : const char *__pyx_filename = NULL;
4890 : int __pyx_clineno = 0;
4891 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
4892 :
4893 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
4894 : *
4895 : * cdef inline object PyArray_MultiIterNew2(a, b):
4896 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
4897 : *
4898 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
4899 : */
4900 : __Pyx_XDECREF(__pyx_r);
4901 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 810, __pyx_L1_error)
4902 : __Pyx_GOTREF(__pyx_t_1);
4903 : __pyx_r = __pyx_t_1;
4904 : __pyx_t_1 = 0;
4905 : goto __pyx_L0;
4906 :
4907 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
4908 : * return PyArray_MultiIterNew(1, <void*>a)
4909 : *
4910 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
4911 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4912 : *
4913 : */
4914 :
4915 : /* function exit code */
4916 : __pyx_L1_error:;
4917 : __Pyx_XDECREF(__pyx_t_1);
4918 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4919 : __pyx_r = 0;
4920 : __pyx_L0:;
4921 : __Pyx_XGIVEREF(__pyx_r);
4922 : __Pyx_RefNannyFinishContext();
4923 : return __pyx_r;
4924 : }
4925 :
4926 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
4927 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4928 : *
4929 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4930 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4931 : *
4932 : */
4933 :
4934 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4935 : PyObject *__pyx_r = NULL;
4936 : __Pyx_RefNannyDeclarations
4937 : PyObject *__pyx_t_1 = NULL;
4938 : int __pyx_lineno = 0;
4939 : const char *__pyx_filename = NULL;
4940 : int __pyx_clineno = 0;
4941 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
4942 :
4943 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
4944 : *
4945 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
4946 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4947 : *
4948 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4949 : */
4950 : __Pyx_XDECREF(__pyx_r);
4951 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 813, __pyx_L1_error)
4952 : __Pyx_GOTREF(__pyx_t_1);
4953 : __pyx_r = __pyx_t_1;
4954 : __pyx_t_1 = 0;
4955 : goto __pyx_L0;
4956 :
4957 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
4958 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4959 : *
4960 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4961 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4962 : *
4963 : */
4964 :
4965 : /* function exit code */
4966 : __pyx_L1_error:;
4967 : __Pyx_XDECREF(__pyx_t_1);
4968 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4969 : __pyx_r = 0;
4970 : __pyx_L0:;
4971 : __Pyx_XGIVEREF(__pyx_r);
4972 : __Pyx_RefNannyFinishContext();
4973 : return __pyx_r;
4974 : }
4975 :
4976 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
4977 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4978 : *
4979 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4980 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4981 : *
4982 : */
4983 :
4984 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4985 : PyObject *__pyx_r = NULL;
4986 : __Pyx_RefNannyDeclarations
4987 : PyObject *__pyx_t_1 = NULL;
4988 : int __pyx_lineno = 0;
4989 : const char *__pyx_filename = NULL;
4990 : int __pyx_clineno = 0;
4991 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
4992 :
4993 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
4994 : *
4995 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4996 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
4997 : *
4998 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4999 : */
5000 : __Pyx_XDECREF(__pyx_r);
5001 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 816, __pyx_L1_error)
5002 : __Pyx_GOTREF(__pyx_t_1);
5003 : __pyx_r = __pyx_t_1;
5004 : __pyx_t_1 = 0;
5005 : goto __pyx_L0;
5006 :
5007 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
5008 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5009 : *
5010 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5011 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5012 : *
5013 : */
5014 :
5015 : /* function exit code */
5016 : __pyx_L1_error:;
5017 : __Pyx_XDECREF(__pyx_t_1);
5018 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
5019 : __pyx_r = 0;
5020 : __pyx_L0:;
5021 : __Pyx_XGIVEREF(__pyx_r);
5022 : __Pyx_RefNannyFinishContext();
5023 : return __pyx_r;
5024 : }
5025 :
5026 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
5027 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5028 : *
5029 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5030 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5031 : *
5032 : */
5033 :
5034 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
5035 : PyObject *__pyx_r = NULL;
5036 : __Pyx_RefNannyDeclarations
5037 : PyObject *__pyx_t_1 = NULL;
5038 : int __pyx_lineno = 0;
5039 : const char *__pyx_filename = NULL;
5040 : int __pyx_clineno = 0;
5041 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
5042 :
5043 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
5044 : *
5045 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5046 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
5047 : *
5048 : * cdef inline tuple PyDataType_SHAPE(dtype d):
5049 : */
5050 : __Pyx_XDECREF(__pyx_r);
5051 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 819, __pyx_L1_error)
5052 : __Pyx_GOTREF(__pyx_t_1);
5053 : __pyx_r = __pyx_t_1;
5054 : __pyx_t_1 = 0;
5055 : goto __pyx_L0;
5056 :
5057 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
5058 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5059 : *
5060 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5061 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5062 : *
5063 : */
5064 :
5065 : /* function exit code */
5066 : __pyx_L1_error:;
5067 : __Pyx_XDECREF(__pyx_t_1);
5068 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5069 : __pyx_r = 0;
5070 : __pyx_L0:;
5071 : __Pyx_XGIVEREF(__pyx_r);
5072 : __Pyx_RefNannyFinishContext();
5073 : return __pyx_r;
5074 : }
5075 :
5076 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
5077 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5078 : *
5079 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5080 : * if PyDataType_HASSUBARRAY(d):
5081 : * return <tuple>d.subarray.shape
5082 : */
5083 :
5084 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5085 : PyObject *__pyx_r = NULL;
5086 : __Pyx_RefNannyDeclarations
5087 : int __pyx_t_1;
5088 : PyObject *__pyx_t_2;
5089 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
5090 :
5091 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
5092 : *
5093 : * cdef inline tuple PyDataType_SHAPE(dtype d):
5094 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5095 : * return <tuple>d.subarray.shape
5096 : * else:
5097 : */
5098 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
5099 : if (__pyx_t_1) {
5100 :
5101 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
5102 : * cdef inline tuple PyDataType_SHAPE(dtype d):
5103 : * if PyDataType_HASSUBARRAY(d):
5104 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
5105 : * else:
5106 : * return ()
5107 : */
5108 : __Pyx_XDECREF(__pyx_r);
5109 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
5110 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
5111 : __pyx_r = ((PyObject*)__pyx_t_2);
5112 : goto __pyx_L0;
5113 :
5114 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
5115 : *
5116 : * cdef inline tuple PyDataType_SHAPE(dtype d):
5117 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5118 : * return <tuple>d.subarray.shape
5119 : * else:
5120 : */
5121 : }
5122 :
5123 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
5124 : * return <tuple>d.subarray.shape
5125 : * else:
5126 : * return () # <<<<<<<<<<<<<<
5127 : *
5128 : *
5129 : */
5130 : /*else*/ {
5131 : __Pyx_XDECREF(__pyx_r);
5132 : __Pyx_INCREF(__pyx_empty_tuple);
5133 : __pyx_r = __pyx_empty_tuple;
5134 : goto __pyx_L0;
5135 : }
5136 :
5137 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
5138 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5139 : *
5140 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5141 : * if PyDataType_HASSUBARRAY(d):
5142 : * return <tuple>d.subarray.shape
5143 : */
5144 :
5145 : /* function exit code */
5146 : __pyx_L0:;
5147 : __Pyx_XGIVEREF(__pyx_r);
5148 : __Pyx_RefNannyFinishContext();
5149 : return __pyx_r;
5150 : }
5151 :
5152 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
5153 : * int _import_umath() except -1
5154 : *
5155 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5156 : * Py_INCREF(base) # important to do this before stealing the reference below!
5157 : * PyArray_SetBaseObject(arr, base)
5158 : */
5159 :
5160 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5161 : int __pyx_t_1;
5162 : int __pyx_lineno = 0;
5163 : const char *__pyx_filename = NULL;
5164 : int __pyx_clineno = 0;
5165 :
5166 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
5167 : *
5168 : * cdef inline void set_array_base(ndarray arr, object base) except *:
5169 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
5170 : * PyArray_SetBaseObject(arr, base)
5171 : *
5172 : */
5173 : Py_INCREF(__pyx_v_base);
5174 :
5175 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
5176 : * cdef inline void set_array_base(ndarray arr, object base) except *:
5177 : * Py_INCREF(base) # important to do this before stealing the reference below!
5178 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
5179 : *
5180 : * cdef inline object get_array_base(ndarray arr):
5181 : */
5182 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1011, __pyx_L1_error)
5183 :
5184 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
5185 : * int _import_umath() except -1
5186 : *
5187 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5188 : * Py_INCREF(base) # important to do this before stealing the reference below!
5189 : * PyArray_SetBaseObject(arr, base)
5190 : */
5191 :
5192 : /* function exit code */
5193 : goto __pyx_L0;
5194 : __pyx_L1_error:;
5195 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5196 : __pyx_L0:;
5197 : }
5198 :
5199 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
5200 : * PyArray_SetBaseObject(arr, base)
5201 : *
5202 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5203 : * base = PyArray_BASE(arr)
5204 : * if base is NULL:
5205 : */
5206 :
5207 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5208 : PyObject *__pyx_v_base;
5209 : PyObject *__pyx_r = NULL;
5210 : __Pyx_RefNannyDeclarations
5211 : int __pyx_t_1;
5212 : __Pyx_RefNannySetupContext("get_array_base", 1);
5213 :
5214 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
5215 : *
5216 : * cdef inline object get_array_base(ndarray arr):
5217 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
5218 : * if base is NULL:
5219 : * return None
5220 : */
5221 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5222 :
5223 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
5224 : * cdef inline object get_array_base(ndarray arr):
5225 : * base = PyArray_BASE(arr)
5226 : * if base is NULL: # <<<<<<<<<<<<<<
5227 : * return None
5228 : * return <object>base
5229 : */
5230 : __pyx_t_1 = (__pyx_v_base == NULL);
5231 : if (__pyx_t_1) {
5232 :
5233 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
5234 : * base = PyArray_BASE(arr)
5235 : * if base is NULL:
5236 : * return None # <<<<<<<<<<<<<<
5237 : * return <object>base
5238 : *
5239 : */
5240 : __Pyx_XDECREF(__pyx_r);
5241 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5242 : goto __pyx_L0;
5243 :
5244 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
5245 : * cdef inline object get_array_base(ndarray arr):
5246 : * base = PyArray_BASE(arr)
5247 : * if base is NULL: # <<<<<<<<<<<<<<
5248 : * return None
5249 : * return <object>base
5250 : */
5251 : }
5252 :
5253 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
5254 : * if base is NULL:
5255 : * return None
5256 : * return <object>base # <<<<<<<<<<<<<<
5257 : *
5258 : * # Versions of the import_* functions which are more suitable for
5259 : */
5260 : __Pyx_XDECREF(__pyx_r);
5261 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
5262 : __pyx_r = ((PyObject *)__pyx_v_base);
5263 : goto __pyx_L0;
5264 :
5265 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
5266 : * PyArray_SetBaseObject(arr, base)
5267 : *
5268 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5269 : * base = PyArray_BASE(arr)
5270 : * if base is NULL:
5271 : */
5272 :
5273 : /* function exit code */
5274 : __pyx_L0:;
5275 : __Pyx_XGIVEREF(__pyx_r);
5276 : __Pyx_RefNannyFinishContext();
5277 : return __pyx_r;
5278 : }
5279 :
5280 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
5281 : * # Versions of the import_* functions which are more suitable for
5282 : * # Cython code.
5283 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5284 : * try:
5285 : * __pyx_import_array()
5286 : */
5287 :
5288 3 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5289 3 : int __pyx_r;
5290 : __Pyx_RefNannyDeclarations
5291 3 : PyObject *__pyx_t_1 = NULL;
5292 3 : PyObject *__pyx_t_2 = NULL;
5293 3 : PyObject *__pyx_t_3 = NULL;
5294 3 : int __pyx_t_4;
5295 3 : PyObject *__pyx_t_5 = NULL;
5296 3 : PyObject *__pyx_t_6 = NULL;
5297 3 : PyObject *__pyx_t_7 = NULL;
5298 3 : PyObject *__pyx_t_8 = NULL;
5299 3 : int __pyx_lineno = 0;
5300 3 : const char *__pyx_filename = NULL;
5301 3 : int __pyx_clineno = 0;
5302 3 : __Pyx_RefNannySetupContext("import_array", 1);
5303 :
5304 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
5305 : * # Cython code.
5306 : * cdef inline int import_array() except -1:
5307 : * try: # <<<<<<<<<<<<<<
5308 : * __pyx_import_array()
5309 : * except Exception:
5310 : */
5311 : {
5312 3 : __Pyx_PyThreadState_declare
5313 3 : __Pyx_PyThreadState_assign
5314 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5315 3 : __Pyx_XGOTREF(__pyx_t_1);
5316 3 : __Pyx_XGOTREF(__pyx_t_2);
5317 3 : __Pyx_XGOTREF(__pyx_t_3);
5318 : /*try:*/ {
5319 :
5320 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
5321 : * cdef inline int import_array() except -1:
5322 : * try:
5323 : * __pyx_import_array() # <<<<<<<<<<<<<<
5324 : * except Exception:
5325 : * raise ImportError("numpy._core.multiarray failed to import")
5326 : */
5327 3 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1023, __pyx_L3_error)
5328 :
5329 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
5330 : * # Cython code.
5331 : * cdef inline int import_array() except -1:
5332 : * try: # <<<<<<<<<<<<<<
5333 : * __pyx_import_array()
5334 : * except Exception:
5335 : */
5336 : }
5337 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5338 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5339 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5340 3 : goto __pyx_L8_try_end;
5341 0 : __pyx_L3_error:;
5342 :
5343 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
5344 : * try:
5345 : * __pyx_import_array()
5346 : * except Exception: # <<<<<<<<<<<<<<
5347 : * raise ImportError("numpy._core.multiarray failed to import")
5348 : *
5349 : */
5350 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5351 0 : if (__pyx_t_4) {
5352 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5353 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1024, __pyx_L5_except_error)
5354 0 : __Pyx_XGOTREF(__pyx_t_5);
5355 0 : __Pyx_XGOTREF(__pyx_t_6);
5356 0 : __Pyx_XGOTREF(__pyx_t_7);
5357 :
5358 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
5359 : * __pyx_import_array()
5360 : * except Exception:
5361 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
5362 : *
5363 : * cdef inline int import_umath() except -1:
5364 : */
5365 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1025, __pyx_L5_except_error)
5366 0 : __Pyx_GOTREF(__pyx_t_8);
5367 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5368 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5369 0 : __PYX_ERR(1, 1025, __pyx_L5_except_error)
5370 : }
5371 0 : goto __pyx_L5_except_error;
5372 :
5373 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
5374 : * # Cython code.
5375 : * cdef inline int import_array() except -1:
5376 : * try: # <<<<<<<<<<<<<<
5377 : * __pyx_import_array()
5378 : * except Exception:
5379 : */
5380 0 : __pyx_L5_except_error:;
5381 0 : __Pyx_XGIVEREF(__pyx_t_1);
5382 0 : __Pyx_XGIVEREF(__pyx_t_2);
5383 0 : __Pyx_XGIVEREF(__pyx_t_3);
5384 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5385 0 : goto __pyx_L1_error;
5386 3 : __pyx_L8_try_end:;
5387 : }
5388 :
5389 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
5390 : * # Versions of the import_* functions which are more suitable for
5391 : * # Cython code.
5392 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5393 : * try:
5394 : * __pyx_import_array()
5395 : */
5396 :
5397 : /* function exit code */
5398 3 : __pyx_r = 0;
5399 3 : goto __pyx_L0;
5400 0 : __pyx_L1_error:;
5401 0 : __Pyx_XDECREF(__pyx_t_5);
5402 0 : __Pyx_XDECREF(__pyx_t_6);
5403 0 : __Pyx_XDECREF(__pyx_t_7);
5404 0 : __Pyx_XDECREF(__pyx_t_8);
5405 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5406 0 : __pyx_r = -1;
5407 3 : __pyx_L0:;
5408 3 : __Pyx_RefNannyFinishContext();
5409 3 : return __pyx_r;
5410 : }
5411 :
5412 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
5413 : * raise ImportError("numpy._core.multiarray failed to import")
5414 : *
5415 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5416 : * try:
5417 : * _import_umath()
5418 : */
5419 :
5420 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5421 : int __pyx_r;
5422 : __Pyx_RefNannyDeclarations
5423 : PyObject *__pyx_t_1 = NULL;
5424 : PyObject *__pyx_t_2 = NULL;
5425 : PyObject *__pyx_t_3 = NULL;
5426 : int __pyx_t_4;
5427 : PyObject *__pyx_t_5 = NULL;
5428 : PyObject *__pyx_t_6 = NULL;
5429 : PyObject *__pyx_t_7 = NULL;
5430 : PyObject *__pyx_t_8 = NULL;
5431 : int __pyx_lineno = 0;
5432 : const char *__pyx_filename = NULL;
5433 : int __pyx_clineno = 0;
5434 : __Pyx_RefNannySetupContext("import_umath", 1);
5435 :
5436 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
5437 : *
5438 : * cdef inline int import_umath() except -1:
5439 : * try: # <<<<<<<<<<<<<<
5440 : * _import_umath()
5441 : * except Exception:
5442 : */
5443 : {
5444 : __Pyx_PyThreadState_declare
5445 : __Pyx_PyThreadState_assign
5446 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5447 : __Pyx_XGOTREF(__pyx_t_1);
5448 : __Pyx_XGOTREF(__pyx_t_2);
5449 : __Pyx_XGOTREF(__pyx_t_3);
5450 : /*try:*/ {
5451 :
5452 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
5453 : * cdef inline int import_umath() except -1:
5454 : * try:
5455 : * _import_umath() # <<<<<<<<<<<<<<
5456 : * except Exception:
5457 : * raise ImportError("numpy._core.umath failed to import")
5458 : */
5459 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1029, __pyx_L3_error)
5460 :
5461 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
5462 : *
5463 : * cdef inline int import_umath() except -1:
5464 : * try: # <<<<<<<<<<<<<<
5465 : * _import_umath()
5466 : * except Exception:
5467 : */
5468 : }
5469 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5470 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5471 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5472 : goto __pyx_L8_try_end;
5473 : __pyx_L3_error:;
5474 :
5475 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
5476 : * try:
5477 : * _import_umath()
5478 : * except Exception: # <<<<<<<<<<<<<<
5479 : * raise ImportError("numpy._core.umath failed to import")
5480 : *
5481 : */
5482 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5483 : if (__pyx_t_4) {
5484 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5485 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1030, __pyx_L5_except_error)
5486 : __Pyx_XGOTREF(__pyx_t_5);
5487 : __Pyx_XGOTREF(__pyx_t_6);
5488 : __Pyx_XGOTREF(__pyx_t_7);
5489 :
5490 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
5491 : * _import_umath()
5492 : * except Exception:
5493 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
5494 : *
5495 : * cdef inline int import_ufunc() except -1:
5496 : */
5497 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1031, __pyx_L5_except_error)
5498 : __Pyx_GOTREF(__pyx_t_8);
5499 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5500 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5501 : __PYX_ERR(1, 1031, __pyx_L5_except_error)
5502 : }
5503 : goto __pyx_L5_except_error;
5504 :
5505 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
5506 : *
5507 : * cdef inline int import_umath() except -1:
5508 : * try: # <<<<<<<<<<<<<<
5509 : * _import_umath()
5510 : * except Exception:
5511 : */
5512 : __pyx_L5_except_error:;
5513 : __Pyx_XGIVEREF(__pyx_t_1);
5514 : __Pyx_XGIVEREF(__pyx_t_2);
5515 : __Pyx_XGIVEREF(__pyx_t_3);
5516 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5517 : goto __pyx_L1_error;
5518 : __pyx_L8_try_end:;
5519 : }
5520 :
5521 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
5522 : * raise ImportError("numpy._core.multiarray failed to import")
5523 : *
5524 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5525 : * try:
5526 : * _import_umath()
5527 : */
5528 :
5529 : /* function exit code */
5530 : __pyx_r = 0;
5531 : goto __pyx_L0;
5532 : __pyx_L1_error:;
5533 : __Pyx_XDECREF(__pyx_t_5);
5534 : __Pyx_XDECREF(__pyx_t_6);
5535 : __Pyx_XDECREF(__pyx_t_7);
5536 : __Pyx_XDECREF(__pyx_t_8);
5537 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5538 : __pyx_r = -1;
5539 : __pyx_L0:;
5540 : __Pyx_RefNannyFinishContext();
5541 : return __pyx_r;
5542 : }
5543 :
5544 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
5545 : * raise ImportError("numpy._core.umath failed to import")
5546 : *
5547 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5548 : * try:
5549 : * _import_umath()
5550 : */
5551 :
5552 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
5553 : int __pyx_r;
5554 : __Pyx_RefNannyDeclarations
5555 : PyObject *__pyx_t_1 = NULL;
5556 : PyObject *__pyx_t_2 = NULL;
5557 : PyObject *__pyx_t_3 = NULL;
5558 : int __pyx_t_4;
5559 : PyObject *__pyx_t_5 = NULL;
5560 : PyObject *__pyx_t_6 = NULL;
5561 : PyObject *__pyx_t_7 = NULL;
5562 : PyObject *__pyx_t_8 = NULL;
5563 : int __pyx_lineno = 0;
5564 : const char *__pyx_filename = NULL;
5565 : int __pyx_clineno = 0;
5566 : __Pyx_RefNannySetupContext("import_ufunc", 1);
5567 :
5568 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
5569 : *
5570 : * cdef inline int import_ufunc() except -1:
5571 : * try: # <<<<<<<<<<<<<<
5572 : * _import_umath()
5573 : * except Exception:
5574 : */
5575 : {
5576 : __Pyx_PyThreadState_declare
5577 : __Pyx_PyThreadState_assign
5578 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5579 : __Pyx_XGOTREF(__pyx_t_1);
5580 : __Pyx_XGOTREF(__pyx_t_2);
5581 : __Pyx_XGOTREF(__pyx_t_3);
5582 : /*try:*/ {
5583 :
5584 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
5585 : * cdef inline int import_ufunc() except -1:
5586 : * try:
5587 : * _import_umath() # <<<<<<<<<<<<<<
5588 : * except Exception:
5589 : * raise ImportError("numpy._core.umath failed to import")
5590 : */
5591 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1035, __pyx_L3_error)
5592 :
5593 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
5594 : *
5595 : * cdef inline int import_ufunc() except -1:
5596 : * try: # <<<<<<<<<<<<<<
5597 : * _import_umath()
5598 : * except Exception:
5599 : */
5600 : }
5601 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5602 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5603 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5604 : goto __pyx_L8_try_end;
5605 : __pyx_L3_error:;
5606 :
5607 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
5608 : * try:
5609 : * _import_umath()
5610 : * except Exception: # <<<<<<<<<<<<<<
5611 : * raise ImportError("numpy._core.umath failed to import")
5612 : *
5613 : */
5614 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5615 : if (__pyx_t_4) {
5616 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5617 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1036, __pyx_L5_except_error)
5618 : __Pyx_XGOTREF(__pyx_t_5);
5619 : __Pyx_XGOTREF(__pyx_t_6);
5620 : __Pyx_XGOTREF(__pyx_t_7);
5621 :
5622 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
5623 : * _import_umath()
5624 : * except Exception:
5625 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
5626 : *
5627 : *
5628 : */
5629 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1037, __pyx_L5_except_error)
5630 : __Pyx_GOTREF(__pyx_t_8);
5631 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5632 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5633 : __PYX_ERR(1, 1037, __pyx_L5_except_error)
5634 : }
5635 : goto __pyx_L5_except_error;
5636 :
5637 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
5638 : *
5639 : * cdef inline int import_ufunc() except -1:
5640 : * try: # <<<<<<<<<<<<<<
5641 : * _import_umath()
5642 : * except Exception:
5643 : */
5644 : __pyx_L5_except_error:;
5645 : __Pyx_XGIVEREF(__pyx_t_1);
5646 : __Pyx_XGIVEREF(__pyx_t_2);
5647 : __Pyx_XGIVEREF(__pyx_t_3);
5648 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5649 : goto __pyx_L1_error;
5650 : __pyx_L8_try_end:;
5651 : }
5652 :
5653 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
5654 : * raise ImportError("numpy._core.umath failed to import")
5655 : *
5656 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5657 : * try:
5658 : * _import_umath()
5659 : */
5660 :
5661 : /* function exit code */
5662 : __pyx_r = 0;
5663 : goto __pyx_L0;
5664 : __pyx_L1_error:;
5665 : __Pyx_XDECREF(__pyx_t_5);
5666 : __Pyx_XDECREF(__pyx_t_6);
5667 : __Pyx_XDECREF(__pyx_t_7);
5668 : __Pyx_XDECREF(__pyx_t_8);
5669 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5670 : __pyx_r = -1;
5671 : __pyx_L0:;
5672 : __Pyx_RefNannyFinishContext();
5673 : return __pyx_r;
5674 : }
5675 :
5676 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
5677 : *
5678 : *
5679 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5680 : * """
5681 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
5682 : */
5683 :
5684 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5685 : int __pyx_r;
5686 :
5687 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
5688 : * bool
5689 : * """
5690 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
5691 : *
5692 : *
5693 : */
5694 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5695 : goto __pyx_L0;
5696 :
5697 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
5698 : *
5699 : *
5700 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5701 : * """
5702 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
5703 : */
5704 :
5705 : /* function exit code */
5706 : __pyx_L0:;
5707 : return __pyx_r;
5708 : }
5709 :
5710 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
5711 : *
5712 : *
5713 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5714 : * """
5715 : * Cython equivalent of `isinstance(obj, np.datetime64)`
5716 : */
5717 :
5718 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5719 : int __pyx_r;
5720 :
5721 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
5722 : * bool
5723 : * """
5724 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
5725 : *
5726 : *
5727 : */
5728 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5729 : goto __pyx_L0;
5730 :
5731 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
5732 : *
5733 : *
5734 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
5735 : * """
5736 : * Cython equivalent of `isinstance(obj, np.datetime64)`
5737 : */
5738 :
5739 : /* function exit code */
5740 : __pyx_L0:;
5741 : return __pyx_r;
5742 : }
5743 :
5744 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
5745 : *
5746 : *
5747 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5748 : * """
5749 : * returns the int64 value underlying scalar numpy datetime64 object
5750 : */
5751 :
5752 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5753 : npy_datetime __pyx_r;
5754 :
5755 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
5756 : * also needed. That can be found using `get_datetime64_unit`.
5757 : * """
5758 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
5759 : *
5760 : *
5761 : */
5762 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
5763 : goto __pyx_L0;
5764 :
5765 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
5766 : *
5767 : *
5768 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5769 : * """
5770 : * returns the int64 value underlying scalar numpy datetime64 object
5771 : */
5772 :
5773 : /* function exit code */
5774 : __pyx_L0:;
5775 : return __pyx_r;
5776 : }
5777 :
5778 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
5779 : *
5780 : *
5781 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5782 : * """
5783 : * returns the int64 value underlying scalar numpy timedelta64 object
5784 : */
5785 :
5786 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5787 : npy_timedelta __pyx_r;
5788 :
5789 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
5790 : * returns the int64 value underlying scalar numpy timedelta64 object
5791 : * """
5792 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
5793 : *
5794 : *
5795 : */
5796 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
5797 : goto __pyx_L0;
5798 :
5799 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
5800 : *
5801 : *
5802 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5803 : * """
5804 : * returns the int64 value underlying scalar numpy timedelta64 object
5805 : */
5806 :
5807 : /* function exit code */
5808 : __pyx_L0:;
5809 : return __pyx_r;
5810 : }
5811 :
5812 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
5813 : *
5814 : *
5815 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5816 : * """
5817 : * returns the unit part of the dtype for a numpy datetime64 object.
5818 : */
5819 :
5820 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5821 : NPY_DATETIMEUNIT __pyx_r;
5822 :
5823 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
5824 : * returns the unit part of the dtype for a numpy datetime64 object.
5825 : * """
5826 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
5827 : *
5828 : *
5829 : */
5830 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
5831 : goto __pyx_L0;
5832 :
5833 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
5834 : *
5835 : *
5836 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
5837 : * """
5838 : * returns the unit part of the dtype for a numpy datetime64 object.
5839 : */
5840 :
5841 : /* function exit code */
5842 : __pyx_L0:;
5843 : return __pyx_r;
5844 : }
5845 :
5846 : /* "scipy/linalg/_decomp_update.pyx":78
5847 : * double_complex
5848 : *
5849 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil: # <<<<<<<<<<<<<<
5850 : * return a + i*as[0] + j*as[1]
5851 : *
5852 : */
5853 :
5854 63129 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(float *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i, int __pyx_v_j) {
5855 63129 : float *__pyx_r;
5856 :
5857 : /* "scipy/linalg/_decomp_update.pyx":79
5858 : *
5859 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil:
5860 : * return a + i*as[0] + j*as[1] # <<<<<<<<<<<<<<
5861 : *
5862 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
5863 : */
5864 63129 : __pyx_r = ((__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0]))) + (__pyx_v_j * (__pyx_v_as[1])));
5865 63129 : goto __pyx_L0;
5866 :
5867 : /* "scipy/linalg/_decomp_update.pyx":78
5868 : * double_complex
5869 : *
5870 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil: # <<<<<<<<<<<<<<
5871 : * return a + i*as[0] + j*as[1]
5872 : *
5873 : */
5874 :
5875 : /* function exit code */
5876 63129 : __pyx_L0:;
5877 63129 : return __pyx_r;
5878 : }
5879 :
5880 79375 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(double *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i, int __pyx_v_j) {
5881 79375 : double *__pyx_r;
5882 :
5883 : /* "scipy/linalg/_decomp_update.pyx":79
5884 : *
5885 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil:
5886 : * return a + i*as[0] + j*as[1] # <<<<<<<<<<<<<<
5887 : *
5888 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
5889 : */
5890 79375 : __pyx_r = ((__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0]))) + (__pyx_v_j * (__pyx_v_as[1])));
5891 79375 : goto __pyx_L0;
5892 :
5893 : /* "scipy/linalg/_decomp_update.pyx":78
5894 : * double_complex
5895 : *
5896 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil: # <<<<<<<<<<<<<<
5897 : * return a + i*as[0] + j*as[1]
5898 : *
5899 : */
5900 :
5901 : /* function exit code */
5902 79375 : __pyx_L0:;
5903 79375 : return __pyx_r;
5904 : }
5905 :
5906 69279 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_t_float_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i, int __pyx_v_j) {
5907 69279 : __pyx_t_float_complex *__pyx_r;
5908 :
5909 : /* "scipy/linalg/_decomp_update.pyx":79
5910 : *
5911 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil:
5912 : * return a + i*as[0] + j*as[1] # <<<<<<<<<<<<<<
5913 : *
5914 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
5915 : */
5916 69279 : __pyx_r = ((__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0]))) + (__pyx_v_j * (__pyx_v_as[1])));
5917 69279 : goto __pyx_L0;
5918 :
5919 : /* "scipy/linalg/_decomp_update.pyx":78
5920 : * double_complex
5921 : *
5922 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil: # <<<<<<<<<<<<<<
5923 : * return a + i*as[0] + j*as[1]
5924 : *
5925 : */
5926 :
5927 : /* function exit code */
5928 69279 : __pyx_L0:;
5929 69279 : return __pyx_r;
5930 : }
5931 :
5932 69827 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_t_double_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i, int __pyx_v_j) {
5933 69827 : __pyx_t_double_complex *__pyx_r;
5934 :
5935 : /* "scipy/linalg/_decomp_update.pyx":79
5936 : *
5937 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil:
5938 : * return a + i*as[0] + j*as[1] # <<<<<<<<<<<<<<
5939 : *
5940 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
5941 : */
5942 69827 : __pyx_r = ((__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0]))) + (__pyx_v_j * (__pyx_v_as[1])));
5943 69827 : goto __pyx_L0;
5944 :
5945 : /* "scipy/linalg/_decomp_update.pyx":78
5946 : * double_complex
5947 : *
5948 : * cdef inline blas_t* index2(blas_t* a, int* as, int i, int j) noexcept nogil: # <<<<<<<<<<<<<<
5949 : * return a + i*as[0] + j*as[1]
5950 : *
5951 : */
5952 :
5953 : /* function exit code */
5954 69827 : __pyx_L0:;
5955 69827 : return __pyx_r;
5956 : }
5957 :
5958 : /* "scipy/linalg/_decomp_update.pyx":81
5959 : * return a + i*as[0] + j*as[1]
5960 : *
5961 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
5962 : * return a + i*as[0]
5963 : *
5964 : */
5965 :
5966 4284 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(float *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
5967 4284 : float *__pyx_r;
5968 :
5969 : /* "scipy/linalg/_decomp_update.pyx":82
5970 : *
5971 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
5972 : * return a + i*as[0] # <<<<<<<<<<<<<<
5973 : *
5974 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
5975 : */
5976 4284 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
5977 4284 : goto __pyx_L0;
5978 :
5979 : /* "scipy/linalg/_decomp_update.pyx":81
5980 : * return a + i*as[0] + j*as[1]
5981 : *
5982 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
5983 : * return a + i*as[0]
5984 : *
5985 : */
5986 :
5987 : /* function exit code */
5988 4284 : __pyx_L0:;
5989 4284 : return __pyx_r;
5990 : }
5991 :
5992 4284 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(double *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
5993 4284 : double *__pyx_r;
5994 :
5995 : /* "scipy/linalg/_decomp_update.pyx":82
5996 : *
5997 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
5998 : * return a + i*as[0] # <<<<<<<<<<<<<<
5999 : *
6000 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
6001 : */
6002 4284 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
6003 4284 : goto __pyx_L0;
6004 :
6005 : /* "scipy/linalg/_decomp_update.pyx":81
6006 : * return a + i*as[0] + j*as[1]
6007 : *
6008 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6009 : * return a + i*as[0]
6010 : *
6011 : */
6012 :
6013 : /* function exit code */
6014 4284 : __pyx_L0:;
6015 4284 : return __pyx_r;
6016 : }
6017 :
6018 17052 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_t_float_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
6019 17052 : __pyx_t_float_complex *__pyx_r;
6020 :
6021 : /* "scipy/linalg/_decomp_update.pyx":82
6022 : *
6023 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
6024 : * return a + i*as[0] # <<<<<<<<<<<<<<
6025 : *
6026 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
6027 : */
6028 17052 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
6029 17052 : goto __pyx_L0;
6030 :
6031 : /* "scipy/linalg/_decomp_update.pyx":81
6032 : * return a + i*as[0] + j*as[1]
6033 : *
6034 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6035 : * return a + i*as[0]
6036 : *
6037 : */
6038 :
6039 : /* function exit code */
6040 17052 : __pyx_L0:;
6041 17052 : return __pyx_r;
6042 : }
6043 :
6044 17052 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_t_double_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
6045 17052 : __pyx_t_double_complex *__pyx_r;
6046 :
6047 : /* "scipy/linalg/_decomp_update.pyx":82
6048 : *
6049 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil:
6050 : * return a + i*as[0] # <<<<<<<<<<<<<<
6051 : *
6052 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
6053 : */
6054 17052 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
6055 17052 : goto __pyx_L0;
6056 :
6057 : /* "scipy/linalg/_decomp_update.pyx":81
6058 : * return a + i*as[0] + j*as[1]
6059 : *
6060 : * cdef inline blas_t* index1(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6061 : * return a + i*as[0]
6062 : *
6063 : */
6064 :
6065 : /* function exit code */
6066 17052 : __pyx_L0:;
6067 17052 : return __pyx_r;
6068 : }
6069 :
6070 : /* "scipy/linalg/_decomp_update.pyx":84
6071 : * return a + i*as[0]
6072 : *
6073 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6074 : * return a + i*as[0]
6075 : *
6076 : */
6077 :
6078 7006 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(float *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
6079 7006 : float *__pyx_r;
6080 :
6081 : /* "scipy/linalg/_decomp_update.pyx":85
6082 : *
6083 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
6084 : * return a + i*as[0] # <<<<<<<<<<<<<<
6085 : *
6086 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6087 : */
6088 7006 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
6089 7006 : goto __pyx_L0;
6090 :
6091 : /* "scipy/linalg/_decomp_update.pyx":84
6092 : * return a + i*as[0]
6093 : *
6094 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6095 : * return a + i*as[0]
6096 : *
6097 : */
6098 :
6099 : /* function exit code */
6100 7006 : __pyx_L0:;
6101 7006 : return __pyx_r;
6102 : }
6103 :
6104 7006 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(double *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
6105 7006 : double *__pyx_r;
6106 :
6107 : /* "scipy/linalg/_decomp_update.pyx":85
6108 : *
6109 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
6110 : * return a + i*as[0] # <<<<<<<<<<<<<<
6111 : *
6112 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6113 : */
6114 7006 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
6115 7006 : goto __pyx_L0;
6116 :
6117 : /* "scipy/linalg/_decomp_update.pyx":84
6118 : * return a + i*as[0]
6119 : *
6120 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6121 : * return a + i*as[0]
6122 : *
6123 : */
6124 :
6125 : /* function exit code */
6126 7006 : __pyx_L0:;
6127 7006 : return __pyx_r;
6128 : }
6129 :
6130 7666 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_t_float_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
6131 7666 : __pyx_t_float_complex *__pyx_r;
6132 :
6133 : /* "scipy/linalg/_decomp_update.pyx":85
6134 : *
6135 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
6136 : * return a + i*as[0] # <<<<<<<<<<<<<<
6137 : *
6138 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6139 : */
6140 7666 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
6141 7666 : goto __pyx_L0;
6142 :
6143 : /* "scipy/linalg/_decomp_update.pyx":84
6144 : * return a + i*as[0]
6145 : *
6146 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6147 : * return a + i*as[0]
6148 : *
6149 : */
6150 :
6151 : /* function exit code */
6152 7666 : __pyx_L0:;
6153 7666 : return __pyx_r;
6154 : }
6155 :
6156 7666 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_t_double_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_i) {
6157 7666 : __pyx_t_double_complex *__pyx_r;
6158 :
6159 : /* "scipy/linalg/_decomp_update.pyx":85
6160 : *
6161 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil:
6162 : * return a + i*as[0] # <<<<<<<<<<<<<<
6163 : *
6164 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6165 : */
6166 7666 : __pyx_r = (__pyx_v_a + (__pyx_v_i * (__pyx_v_as[0])));
6167 7666 : goto __pyx_L0;
6168 :
6169 : /* "scipy/linalg/_decomp_update.pyx":84
6170 : * return a + i*as[0]
6171 : *
6172 : * cdef inline blas_t* row(blas_t* a, int* as, int i) noexcept nogil: # <<<<<<<<<<<<<<
6173 : * return a + i*as[0]
6174 : *
6175 : */
6176 :
6177 : /* function exit code */
6178 7666 : __pyx_L0:;
6179 7666 : return __pyx_r;
6180 : }
6181 :
6182 : /* "scipy/linalg/_decomp_update.pyx":87
6183 : * return a + i*as[0]
6184 : *
6185 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil: # <<<<<<<<<<<<<<
6186 : * return a + j*as[1]
6187 : *
6188 : */
6189 :
6190 18192 : static CYTHON_INLINE float *__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(float *__pyx_v_a, int *__pyx_v_as, int __pyx_v_j) {
6191 18192 : float *__pyx_r;
6192 :
6193 : /* "scipy/linalg/_decomp_update.pyx":88
6194 : *
6195 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6196 : * return a + j*as[1] # <<<<<<<<<<<<<<
6197 : *
6198 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil:
6199 : */
6200 18192 : __pyx_r = (__pyx_v_a + (__pyx_v_j * (__pyx_v_as[1])));
6201 18192 : goto __pyx_L0;
6202 :
6203 : /* "scipy/linalg/_decomp_update.pyx":87
6204 : * return a + i*as[0]
6205 : *
6206 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil: # <<<<<<<<<<<<<<
6207 : * return a + j*as[1]
6208 : *
6209 : */
6210 :
6211 : /* function exit code */
6212 18192 : __pyx_L0:;
6213 18192 : return __pyx_r;
6214 : }
6215 :
6216 50684 : static CYTHON_INLINE double *__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(double *__pyx_v_a, int *__pyx_v_as, int __pyx_v_j) {
6217 50684 : double *__pyx_r;
6218 :
6219 : /* "scipy/linalg/_decomp_update.pyx":88
6220 : *
6221 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6222 : * return a + j*as[1] # <<<<<<<<<<<<<<
6223 : *
6224 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil:
6225 : */
6226 50684 : __pyx_r = (__pyx_v_a + (__pyx_v_j * (__pyx_v_as[1])));
6227 50684 : goto __pyx_L0;
6228 :
6229 : /* "scipy/linalg/_decomp_update.pyx":87
6230 : * return a + i*as[0]
6231 : *
6232 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil: # <<<<<<<<<<<<<<
6233 : * return a + j*as[1]
6234 : *
6235 : */
6236 :
6237 : /* function exit code */
6238 50684 : __pyx_L0:;
6239 50684 : return __pyx_r;
6240 : }
6241 :
6242 18400 : static CYTHON_INLINE __pyx_t_float_complex *__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_t_float_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_j) {
6243 18400 : __pyx_t_float_complex *__pyx_r;
6244 :
6245 : /* "scipy/linalg/_decomp_update.pyx":88
6246 : *
6247 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6248 : * return a + j*as[1] # <<<<<<<<<<<<<<
6249 : *
6250 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil:
6251 : */
6252 18400 : __pyx_r = (__pyx_v_a + (__pyx_v_j * (__pyx_v_as[1])));
6253 18400 : goto __pyx_L0;
6254 :
6255 : /* "scipy/linalg/_decomp_update.pyx":87
6256 : * return a + i*as[0]
6257 : *
6258 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil: # <<<<<<<<<<<<<<
6259 : * return a + j*as[1]
6260 : *
6261 : */
6262 :
6263 : /* function exit code */
6264 18400 : __pyx_L0:;
6265 18400 : return __pyx_r;
6266 : }
6267 :
6268 19496 : static CYTHON_INLINE __pyx_t_double_complex *__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_t_double_complex *__pyx_v_a, int *__pyx_v_as, int __pyx_v_j) {
6269 19496 : __pyx_t_double_complex *__pyx_r;
6270 :
6271 : /* "scipy/linalg/_decomp_update.pyx":88
6272 : *
6273 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil:
6274 : * return a + j*as[1] # <<<<<<<<<<<<<<
6275 : *
6276 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil:
6277 : */
6278 19496 : __pyx_r = (__pyx_v_a + (__pyx_v_j * (__pyx_v_as[1])));
6279 19496 : goto __pyx_L0;
6280 :
6281 : /* "scipy/linalg/_decomp_update.pyx":87
6282 : * return a + i*as[0]
6283 : *
6284 : * cdef inline blas_t* col(blas_t* a, int* as, int j) noexcept nogil: # <<<<<<<<<<<<<<
6285 : * return a + j*as[1]
6286 : *
6287 : */
6288 :
6289 : /* function exit code */
6290 19496 : __pyx_L0:;
6291 19496 : return __pyx_r;
6292 : }
6293 :
6294 : /* "scipy/linalg/_decomp_update.pyx":90
6295 : * return a + j*as[1]
6296 : *
6297 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6298 : * if blas_t is float:
6299 : * blas_pointers.scopy(&n, x, &incx, y, &incy)
6300 : */
6301 :
6302 7459 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(int __pyx_v_n, float *__pyx_v_x, int __pyx_v_incx, float *__pyx_v_y, int __pyx_v_incy) {
6303 :
6304 : /* "scipy/linalg/_decomp_update.pyx":92
6305 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil:
6306 : * if blas_t is float:
6307 : * blas_pointers.scopy(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6308 : * elif blas_t is double:
6309 : * blas_pointers.dcopy(&n, x, &incx, y, &incy)
6310 : */
6311 7459 : __pyx_f_5scipy_6linalg_11cython_blas_scopy((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6312 :
6313 : /* "scipy/linalg/_decomp_update.pyx":90
6314 : * return a + j*as[1]
6315 : *
6316 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6317 : * if blas_t is float:
6318 : * blas_pointers.scopy(&n, x, &incx, y, &incy)
6319 : */
6320 :
6321 : /* function exit code */
6322 : }
6323 :
6324 7459 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(int __pyx_v_n, double *__pyx_v_x, int __pyx_v_incx, double *__pyx_v_y, int __pyx_v_incy) {
6325 :
6326 : /* "scipy/linalg/_decomp_update.pyx":94
6327 : * blas_pointers.scopy(&n, x, &incx, y, &incy)
6328 : * elif blas_t is double:
6329 : * blas_pointers.dcopy(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6330 : * elif blas_t is float_complex:
6331 : * blas_pointers.ccopy(&n, x, &incx, y, &incy)
6332 : */
6333 7459 : __pyx_f_5scipy_6linalg_11cython_blas_dcopy((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6334 :
6335 : /* "scipy/linalg/_decomp_update.pyx":90
6336 : * return a + j*as[1]
6337 : *
6338 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6339 : * if blas_t is float:
6340 : * blas_pointers.scopy(&n, x, &incx, y, &incy)
6341 : */
6342 :
6343 : /* function exit code */
6344 : }
6345 :
6346 7459 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(int __pyx_v_n, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_float_complex *__pyx_v_y, int __pyx_v_incy) {
6347 :
6348 : /* "scipy/linalg/_decomp_update.pyx":96
6349 : * blas_pointers.dcopy(&n, x, &incx, y, &incy)
6350 : * elif blas_t is float_complex:
6351 : * blas_pointers.ccopy(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6352 : * else: # blas_t is double_complex:
6353 : * blas_pointers.zcopy(&n, x, &incx, y, &incy)
6354 : */
6355 7459 : __pyx_f_5scipy_6linalg_11cython_blas_ccopy((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6356 :
6357 : /* "scipy/linalg/_decomp_update.pyx":90
6358 : * return a + j*as[1]
6359 : *
6360 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6361 : * if blas_t is float:
6362 : * blas_pointers.scopy(&n, x, &incx, y, &incy)
6363 : */
6364 :
6365 : /* function exit code */
6366 : }
6367 :
6368 7459 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(int __pyx_v_n, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_double_complex *__pyx_v_y, int __pyx_v_incy) {
6369 :
6370 : /* "scipy/linalg/_decomp_update.pyx":98
6371 : * blas_pointers.ccopy(&n, x, &incx, y, &incy)
6372 : * else: # blas_t is double_complex:
6373 : * blas_pointers.zcopy(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6374 : *
6375 : * cdef inline void swap(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil:
6376 : */
6377 7459 : __pyx_f_5scipy_6linalg_11cython_blas_zcopy((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6378 :
6379 : /* "scipy/linalg/_decomp_update.pyx":90
6380 : * return a + j*as[1]
6381 : *
6382 : * cdef inline void copy(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6383 : * if blas_t is float:
6384 : * blas_pointers.scopy(&n, x, &incx, y, &incy)
6385 : */
6386 :
6387 : /* function exit code */
6388 : }
6389 :
6390 : /* "scipy/linalg/_decomp_update.pyx":100
6391 : * blas_pointers.zcopy(&n, x, &incx, y, &incy)
6392 : *
6393 : * cdef inline void swap(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6394 : * if blas_t is float:
6395 : * blas_pointers.sswap(&n, x, &incx, y, &incy)
6396 : */
6397 :
6398 2194 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_swap(int __pyx_v_n, float *__pyx_v_x, int __pyx_v_incx, float *__pyx_v_y, int __pyx_v_incy) {
6399 :
6400 : /* "scipy/linalg/_decomp_update.pyx":102
6401 : * cdef inline void swap(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil:
6402 : * if blas_t is float:
6403 : * blas_pointers.sswap(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6404 : * elif blas_t is double:
6405 : * blas_pointers.dswap(&n, x, &incx, y, &incy)
6406 : */
6407 2194 : __pyx_f_5scipy_6linalg_11cython_blas_sswap((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6408 :
6409 : /* "scipy/linalg/_decomp_update.pyx":100
6410 : * blas_pointers.zcopy(&n, x, &incx, y, &incy)
6411 : *
6412 : * cdef inline void swap(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6413 : * if blas_t is float:
6414 : * blas_pointers.sswap(&n, x, &incx, y, &incy)
6415 : */
6416 :
6417 : /* function exit code */
6418 : }
6419 :
6420 2194 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_swap(int __pyx_v_n, double *__pyx_v_x, int __pyx_v_incx, double *__pyx_v_y, int __pyx_v_incy) {
6421 :
6422 : /* "scipy/linalg/_decomp_update.pyx":104
6423 : * blas_pointers.sswap(&n, x, &incx, y, &incy)
6424 : * elif blas_t is double:
6425 : * blas_pointers.dswap(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6426 : * elif blas_t is float_complex:
6427 : * blas_pointers.cswap(&n, x, &incx, y, &incy)
6428 : */
6429 2194 : __pyx_f_5scipy_6linalg_11cython_blas_dswap((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6430 :
6431 : /* "scipy/linalg/_decomp_update.pyx":100
6432 : * blas_pointers.zcopy(&n, x, &incx, y, &incy)
6433 : *
6434 : * cdef inline void swap(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6435 : * if blas_t is float:
6436 : * blas_pointers.sswap(&n, x, &incx, y, &incy)
6437 : */
6438 :
6439 : /* function exit code */
6440 : }
6441 :
6442 2194 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_swap(int __pyx_v_n, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_float_complex *__pyx_v_y, int __pyx_v_incy) {
6443 :
6444 : /* "scipy/linalg/_decomp_update.pyx":106
6445 : * blas_pointers.dswap(&n, x, &incx, y, &incy)
6446 : * elif blas_t is float_complex:
6447 : * blas_pointers.cswap(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6448 : * else: # blas_t is double_complex:
6449 : * blas_pointers.zswap(&n, x, &incx, y, &incy)
6450 : */
6451 2194 : __pyx_f_5scipy_6linalg_11cython_blas_cswap((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6452 :
6453 : /* "scipy/linalg/_decomp_update.pyx":100
6454 : * blas_pointers.zcopy(&n, x, &incx, y, &incy)
6455 : *
6456 : * cdef inline void swap(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6457 : * if blas_t is float:
6458 : * blas_pointers.sswap(&n, x, &incx, y, &incy)
6459 : */
6460 :
6461 : /* function exit code */
6462 : }
6463 :
6464 2194 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_swap(int __pyx_v_n, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_double_complex *__pyx_v_y, int __pyx_v_incy) {
6465 :
6466 : /* "scipy/linalg/_decomp_update.pyx":108
6467 : * blas_pointers.cswap(&n, x, &incx, y, &incy)
6468 : * else: # blas_t is double_complex:
6469 : * blas_pointers.zswap(&n, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6470 : *
6471 : * cdef inline void scal(int n, blas_t a, blas_t* x, int incx) noexcept nogil:
6472 : */
6473 2194 : __pyx_f_5scipy_6linalg_11cython_blas_zswap((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6474 :
6475 : /* "scipy/linalg/_decomp_update.pyx":100
6476 : * blas_pointers.zcopy(&n, x, &incx, y, &incy)
6477 : *
6478 : * cdef inline void swap(int n, blas_t* x, int incx, blas_t* y, int incy) noexcept nogil: # <<<<<<<<<<<<<<
6479 : * if blas_t is float:
6480 : * blas_pointers.sswap(&n, x, &incx, y, &incy)
6481 : */
6482 :
6483 : /* function exit code */
6484 : }
6485 :
6486 : /* "scipy/linalg/_decomp_update.pyx":110
6487 : * blas_pointers.zswap(&n, x, &incx, y, &incy)
6488 : *
6489 : * cdef inline void scal(int n, blas_t a, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6490 : * if blas_t is float:
6491 : * blas_pointers.sscal(&n, &a, x, &incx)
6492 : */
6493 :
6494 994 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(int __pyx_v_n, float __pyx_v_a, float *__pyx_v_x, int __pyx_v_incx) {
6495 :
6496 : /* "scipy/linalg/_decomp_update.pyx":112
6497 : * cdef inline void scal(int n, blas_t a, blas_t* x, int incx) noexcept nogil:
6498 : * if blas_t is float:
6499 : * blas_pointers.sscal(&n, &a, x, &incx) # <<<<<<<<<<<<<<
6500 : * elif blas_t is double:
6501 : * blas_pointers.dscal(&n, &a, x, &incx)
6502 : */
6503 994 : __pyx_f_5scipy_6linalg_11cython_blas_sscal((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx));
6504 :
6505 : /* "scipy/linalg/_decomp_update.pyx":110
6506 : * blas_pointers.zswap(&n, x, &incx, y, &incy)
6507 : *
6508 : * cdef inline void scal(int n, blas_t a, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6509 : * if blas_t is float:
6510 : * blas_pointers.sscal(&n, &a, x, &incx)
6511 : */
6512 :
6513 : /* function exit code */
6514 : }
6515 :
6516 994 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(int __pyx_v_n, double __pyx_v_a, double *__pyx_v_x, int __pyx_v_incx) {
6517 :
6518 : /* "scipy/linalg/_decomp_update.pyx":114
6519 : * blas_pointers.sscal(&n, &a, x, &incx)
6520 : * elif blas_t is double:
6521 : * blas_pointers.dscal(&n, &a, x, &incx) # <<<<<<<<<<<<<<
6522 : * elif blas_t is float_complex:
6523 : * blas_pointers.cscal(&n, &a, x, &incx)
6524 : */
6525 994 : __pyx_f_5scipy_6linalg_11cython_blas_dscal((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx));
6526 :
6527 : /* "scipy/linalg/_decomp_update.pyx":110
6528 : * blas_pointers.zswap(&n, x, &incx, y, &incy)
6529 : *
6530 : * cdef inline void scal(int n, blas_t a, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6531 : * if blas_t is float:
6532 : * blas_pointers.sscal(&n, &a, x, &incx)
6533 : */
6534 :
6535 : /* function exit code */
6536 : }
6537 :
6538 994 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(int __pyx_v_n, __pyx_t_float_complex __pyx_v_a, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx) {
6539 :
6540 : /* "scipy/linalg/_decomp_update.pyx":116
6541 : * blas_pointers.dscal(&n, &a, x, &incx)
6542 : * elif blas_t is float_complex:
6543 : * blas_pointers.cscal(&n, &a, x, &incx) # <<<<<<<<<<<<<<
6544 : * else: # blas_t is double_complex:
6545 : * blas_pointers.zscal(&n, &a, x, &incx)
6546 : */
6547 994 : __pyx_f_5scipy_6linalg_11cython_blas_cscal((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx));
6548 :
6549 : /* "scipy/linalg/_decomp_update.pyx":110
6550 : * blas_pointers.zswap(&n, x, &incx, y, &incy)
6551 : *
6552 : * cdef inline void scal(int n, blas_t a, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6553 : * if blas_t is float:
6554 : * blas_pointers.sscal(&n, &a, x, &incx)
6555 : */
6556 :
6557 : /* function exit code */
6558 : }
6559 :
6560 994 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(int __pyx_v_n, __pyx_t_double_complex __pyx_v_a, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx) {
6561 :
6562 : /* "scipy/linalg/_decomp_update.pyx":118
6563 : * blas_pointers.cscal(&n, &a, x, &incx)
6564 : * else: # blas_t is double_complex:
6565 : * blas_pointers.zscal(&n, &a, x, &incx) # <<<<<<<<<<<<<<
6566 : *
6567 : * cdef inline void axpy(int n, blas_t a, blas_t* x, int incx,
6568 : */
6569 994 : __pyx_f_5scipy_6linalg_11cython_blas_zscal((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx));
6570 :
6571 : /* "scipy/linalg/_decomp_update.pyx":110
6572 : * blas_pointers.zswap(&n, x, &incx, y, &incy)
6573 : *
6574 : * cdef inline void scal(int n, blas_t a, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6575 : * if blas_t is float:
6576 : * blas_pointers.sscal(&n, &a, x, &incx)
6577 : */
6578 :
6579 : /* function exit code */
6580 : }
6581 :
6582 : /* "scipy/linalg/_decomp_update.pyx":120
6583 : * blas_pointers.zscal(&n, &a, x, &incx)
6584 : *
6585 : * cdef inline void axpy(int n, blas_t a, blas_t* x, int incx, # <<<<<<<<<<<<<<
6586 : * blas_t* y, int incy) noexcept nogil:
6587 : * if blas_t is float:
6588 : */
6589 :
6590 1508 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int __pyx_v_n, float __pyx_v_a, float *__pyx_v_x, int __pyx_v_incx, float *__pyx_v_y, int __pyx_v_incy) {
6591 :
6592 : /* "scipy/linalg/_decomp_update.pyx":123
6593 : * blas_t* y, int incy) noexcept nogil:
6594 : * if blas_t is float:
6595 : * blas_pointers.saxpy(&n, &a, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6596 : * elif blas_t is double:
6597 : * blas_pointers.daxpy(&n, &a, x, &incx, y, &incy)
6598 : */
6599 1508 : __pyx_f_5scipy_6linalg_11cython_blas_saxpy((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6600 :
6601 : /* "scipy/linalg/_decomp_update.pyx":120
6602 : * blas_pointers.zscal(&n, &a, x, &incx)
6603 : *
6604 : * cdef inline void axpy(int n, blas_t a, blas_t* x, int incx, # <<<<<<<<<<<<<<
6605 : * blas_t* y, int incy) noexcept nogil:
6606 : * if blas_t is float:
6607 : */
6608 :
6609 : /* function exit code */
6610 : }
6611 :
6612 1508 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int __pyx_v_n, double __pyx_v_a, double *__pyx_v_x, int __pyx_v_incx, double *__pyx_v_y, int __pyx_v_incy) {
6613 :
6614 : /* "scipy/linalg/_decomp_update.pyx":125
6615 : * blas_pointers.saxpy(&n, &a, x, &incx, y, &incy)
6616 : * elif blas_t is double:
6617 : * blas_pointers.daxpy(&n, &a, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6618 : * elif blas_t is float_complex:
6619 : * blas_pointers.caxpy(&n, &a, x, &incx, y, &incy)
6620 : */
6621 1508 : __pyx_f_5scipy_6linalg_11cython_blas_daxpy((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6622 :
6623 : /* "scipy/linalg/_decomp_update.pyx":120
6624 : * blas_pointers.zscal(&n, &a, x, &incx)
6625 : *
6626 : * cdef inline void axpy(int n, blas_t a, blas_t* x, int incx, # <<<<<<<<<<<<<<
6627 : * blas_t* y, int incy) noexcept nogil:
6628 : * if blas_t is float:
6629 : */
6630 :
6631 : /* function exit code */
6632 : }
6633 :
6634 1518 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int __pyx_v_n, __pyx_t_float_complex __pyx_v_a, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_float_complex *__pyx_v_y, int __pyx_v_incy) {
6635 :
6636 : /* "scipy/linalg/_decomp_update.pyx":127
6637 : * blas_pointers.daxpy(&n, &a, x, &incx, y, &incy)
6638 : * elif blas_t is float_complex:
6639 : * blas_pointers.caxpy(&n, &a, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6640 : * else: # blas_t is double_complex:
6641 : * blas_pointers.zaxpy(&n, &a, x, &incx, y, &incy)
6642 : */
6643 1518 : __pyx_f_5scipy_6linalg_11cython_blas_caxpy((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6644 :
6645 : /* "scipy/linalg/_decomp_update.pyx":120
6646 : * blas_pointers.zscal(&n, &a, x, &incx)
6647 : *
6648 : * cdef inline void axpy(int n, blas_t a, blas_t* x, int incx, # <<<<<<<<<<<<<<
6649 : * blas_t* y, int incy) noexcept nogil:
6650 : * if blas_t is float:
6651 : */
6652 :
6653 : /* function exit code */
6654 : }
6655 :
6656 1518 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(int __pyx_v_n, __pyx_t_double_complex __pyx_v_a, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_double_complex *__pyx_v_y, int __pyx_v_incy) {
6657 :
6658 : /* "scipy/linalg/_decomp_update.pyx":129
6659 : * blas_pointers.caxpy(&n, &a, x, &incx, y, &incy)
6660 : * else: # blas_t is double_complex:
6661 : * blas_pointers.zaxpy(&n, &a, x, &incx, y, &incy) # <<<<<<<<<<<<<<
6662 : *
6663 : * cdef inline blas_t nrm2(int n, blas_t* x, int incx) noexcept nogil:
6664 : */
6665 1518 : __pyx_f_5scipy_6linalg_11cython_blas_zaxpy((&__pyx_v_n), (&__pyx_v_a), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy));
6666 :
6667 : /* "scipy/linalg/_decomp_update.pyx":120
6668 : * blas_pointers.zscal(&n, &a, x, &incx)
6669 : *
6670 : * cdef inline void axpy(int n, blas_t a, blas_t* x, int incx, # <<<<<<<<<<<<<<
6671 : * blas_t* y, int incy) noexcept nogil:
6672 : * if blas_t is float:
6673 : */
6674 :
6675 : /* function exit code */
6676 : }
6677 :
6678 : /* "scipy/linalg/_decomp_update.pyx":131
6679 : * blas_pointers.zaxpy(&n, &a, x, &incx, y, &incy)
6680 : *
6681 : * cdef inline blas_t nrm2(int n, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6682 : * if blas_t is float:
6683 : * return blas_pointers.snrm2(&n, x, &incx)
6684 : */
6685 :
6686 1373 : static CYTHON_INLINE float __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int __pyx_v_n, float *__pyx_v_x, int __pyx_v_incx) {
6687 1373 : float __pyx_r;
6688 :
6689 : /* "scipy/linalg/_decomp_update.pyx":133
6690 : * cdef inline blas_t nrm2(int n, blas_t* x, int incx) noexcept nogil:
6691 : * if blas_t is float:
6692 : * return blas_pointers.snrm2(&n, x, &incx) # <<<<<<<<<<<<<<
6693 : * elif blas_t is double:
6694 : * return blas_pointers.dnrm2(&n, x, &incx)
6695 : */
6696 2746 : __pyx_r = __pyx_f_5scipy_6linalg_11cython_blas_snrm2((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx));
6697 1373 : goto __pyx_L0;
6698 :
6699 : /* "scipy/linalg/_decomp_update.pyx":131
6700 : * blas_pointers.zaxpy(&n, &a, x, &incx, y, &incy)
6701 : *
6702 : * cdef inline blas_t nrm2(int n, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6703 : * if blas_t is float:
6704 : * return blas_pointers.snrm2(&n, x, &incx)
6705 : */
6706 :
6707 : /* function exit code */
6708 1373 : __pyx_L0:;
6709 1373 : return __pyx_r;
6710 : }
6711 :
6712 1373 : static CYTHON_INLINE double __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int __pyx_v_n, double *__pyx_v_x, int __pyx_v_incx) {
6713 1373 : double __pyx_r;
6714 :
6715 : /* "scipy/linalg/_decomp_update.pyx":135
6716 : * return blas_pointers.snrm2(&n, x, &incx)
6717 : * elif blas_t is double:
6718 : * return blas_pointers.dnrm2(&n, x, &incx) # <<<<<<<<<<<<<<
6719 : * elif blas_t is float_complex:
6720 : * return blas_pointers.scnrm2(&n, x, &incx)
6721 : */
6722 2746 : __pyx_r = __pyx_f_5scipy_6linalg_11cython_blas_dnrm2((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx));
6723 1373 : goto __pyx_L0;
6724 :
6725 : /* "scipy/linalg/_decomp_update.pyx":131
6726 : * blas_pointers.zaxpy(&n, &a, x, &incx, y, &incy)
6727 : *
6728 : * cdef inline blas_t nrm2(int n, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6729 : * if blas_t is float:
6730 : * return blas_pointers.snrm2(&n, x, &incx)
6731 : */
6732 :
6733 : /* function exit code */
6734 1373 : __pyx_L0:;
6735 1373 : return __pyx_r;
6736 : }
6737 :
6738 1383 : static CYTHON_INLINE __pyx_t_float_complex __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int __pyx_v_n, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx) {
6739 1383 : __pyx_t_float_complex __pyx_r;
6740 :
6741 : /* "scipy/linalg/_decomp_update.pyx":137
6742 : * return blas_pointers.dnrm2(&n, x, &incx)
6743 : * elif blas_t is float_complex:
6744 : * return blas_pointers.scnrm2(&n, x, &incx) # <<<<<<<<<<<<<<
6745 : * else: # blas_t is double_complex:
6746 : * return blas_pointers.dznrm2(&n, x, &incx)
6747 : */
6748 1383 : __pyx_r = __pyx_t_float_complex_from_parts(__pyx_f_5scipy_6linalg_11cython_blas_scnrm2((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx)), 0);
6749 1383 : goto __pyx_L0;
6750 :
6751 : /* "scipy/linalg/_decomp_update.pyx":131
6752 : * blas_pointers.zaxpy(&n, &a, x, &incx, y, &incy)
6753 : *
6754 : * cdef inline blas_t nrm2(int n, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6755 : * if blas_t is float:
6756 : * return blas_pointers.snrm2(&n, x, &incx)
6757 : */
6758 :
6759 : /* function exit code */
6760 1383 : __pyx_L0:;
6761 1383 : return __pyx_r;
6762 : }
6763 :
6764 1383 : static CYTHON_INLINE __pyx_t_double_complex __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(int __pyx_v_n, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx) {
6765 1383 : __pyx_t_double_complex __pyx_r;
6766 :
6767 : /* "scipy/linalg/_decomp_update.pyx":139
6768 : * return blas_pointers.scnrm2(&n, x, &incx)
6769 : * else: # blas_t is double_complex:
6770 : * return blas_pointers.dznrm2(&n, x, &incx) # <<<<<<<<<<<<<<
6771 : *
6772 : * cdef inline void lartg(blas_t* a, blas_t* b, blas_t* c, blas_t* s) noexcept nogil:
6773 : */
6774 1383 : __pyx_r = __pyx_t_double_complex_from_parts(__pyx_f_5scipy_6linalg_11cython_blas_dznrm2((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx)), 0);
6775 1383 : goto __pyx_L0;
6776 :
6777 : /* "scipy/linalg/_decomp_update.pyx":131
6778 : * blas_pointers.zaxpy(&n, &a, x, &incx, y, &incy)
6779 : *
6780 : * cdef inline blas_t nrm2(int n, blas_t* x, int incx) noexcept nogil: # <<<<<<<<<<<<<<
6781 : * if blas_t is float:
6782 : * return blas_pointers.snrm2(&n, x, &incx)
6783 : */
6784 :
6785 : /* function exit code */
6786 1383 : __pyx_L0:;
6787 1383 : return __pyx_r;
6788 : }
6789 :
6790 : /* "scipy/linalg/_decomp_update.pyx":141
6791 : * return blas_pointers.dznrm2(&n, x, &incx)
6792 : *
6793 : * cdef inline void lartg(blas_t* a, blas_t* b, blas_t* c, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
6794 : * cdef blas_t g
6795 : * if blas_t is float:
6796 : */
6797 :
6798 19739 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(float *__pyx_v_a, float *__pyx_v_b, float *__pyx_v_c, float *__pyx_v_s) {
6799 19739 : float __pyx_v_g;
6800 :
6801 : /* "scipy/linalg/_decomp_update.pyx":144
6802 : * cdef blas_t g
6803 : * if blas_t is float:
6804 : * lapack_pointers.slartg(a, b, c, s, &g) # <<<<<<<<<<<<<<
6805 : * elif blas_t is double:
6806 : * lapack_pointers.dlartg(a, b, c, s, &g)
6807 : */
6808 19739 : __pyx_f_5scipy_6linalg_13cython_lapack_slartg(__pyx_v_a, __pyx_v_b, __pyx_v_c, __pyx_v_s, (&__pyx_v_g));
6809 :
6810 : /* "scipy/linalg/_decomp_update.pyx":154
6811 : * lapack_pointers.zlartg(a, b, <double*>c, s, &g)
6812 : * # make this function more like the BLAS drotg
6813 : * a[0] = g # <<<<<<<<<<<<<<
6814 : * b[0] = 0
6815 : *
6816 : */
6817 19739 : (__pyx_v_a[0]) = __pyx_v_g;
6818 :
6819 : /* "scipy/linalg/_decomp_update.pyx":155
6820 : * # make this function more like the BLAS drotg
6821 : * a[0] = g
6822 : * b[0] = 0 # <<<<<<<<<<<<<<
6823 : *
6824 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy,
6825 : */
6826 19739 : (__pyx_v_b[0]) = 0.0;
6827 :
6828 : /* "scipy/linalg/_decomp_update.pyx":141
6829 : * return blas_pointers.dznrm2(&n, x, &incx)
6830 : *
6831 : * cdef inline void lartg(blas_t* a, blas_t* b, blas_t* c, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
6832 : * cdef blas_t g
6833 : * if blas_t is float:
6834 : */
6835 :
6836 : /* function exit code */
6837 : }
6838 :
6839 35985 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(double *__pyx_v_a, double *__pyx_v_b, double *__pyx_v_c, double *__pyx_v_s) {
6840 35985 : double __pyx_v_g;
6841 :
6842 : /* "scipy/linalg/_decomp_update.pyx":146
6843 : * lapack_pointers.slartg(a, b, c, s, &g)
6844 : * elif blas_t is double:
6845 : * lapack_pointers.dlartg(a, b, c, s, &g) # <<<<<<<<<<<<<<
6846 : * elif blas_t is float_complex:
6847 : * c[0] = 0. # init imag
6848 : */
6849 35985 : __pyx_f_5scipy_6linalg_13cython_lapack_dlartg(__pyx_v_a, __pyx_v_b, __pyx_v_c, __pyx_v_s, (&__pyx_v_g));
6850 :
6851 : /* "scipy/linalg/_decomp_update.pyx":154
6852 : * lapack_pointers.zlartg(a, b, <double*>c, s, &g)
6853 : * # make this function more like the BLAS drotg
6854 : * a[0] = g # <<<<<<<<<<<<<<
6855 : * b[0] = 0
6856 : *
6857 : */
6858 35985 : (__pyx_v_a[0]) = __pyx_v_g;
6859 :
6860 : /* "scipy/linalg/_decomp_update.pyx":155
6861 : * # make this function more like the BLAS drotg
6862 : * a[0] = g
6863 : * b[0] = 0 # <<<<<<<<<<<<<<
6864 : *
6865 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy,
6866 : */
6867 35985 : (__pyx_v_b[0]) = 0.0;
6868 :
6869 : /* "scipy/linalg/_decomp_update.pyx":141
6870 : * return blas_pointers.dznrm2(&n, x, &incx)
6871 : *
6872 : * cdef inline void lartg(blas_t* a, blas_t* b, blas_t* c, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
6873 : * cdef blas_t g
6874 : * if blas_t is float:
6875 : */
6876 :
6877 : /* function exit code */
6878 : }
6879 :
6880 19739 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_t_float_complex *__pyx_v_a, __pyx_t_float_complex *__pyx_v_b, __pyx_t_float_complex *__pyx_v_c, __pyx_t_float_complex *__pyx_v_s) {
6881 19739 : __pyx_t_float_complex __pyx_v_g;
6882 :
6883 : /* "scipy/linalg/_decomp_update.pyx":148
6884 : * lapack_pointers.dlartg(a, b, c, s, &g)
6885 : * elif blas_t is float_complex:
6886 : * c[0] = 0. # init imag # <<<<<<<<<<<<<<
6887 : * lapack_pointers.clartg(a, b, <float*>c, s, &g)
6888 : * else:
6889 : */
6890 19739 : (__pyx_v_c[0]) = __pyx_t_float_complex_from_parts(0., 0);
6891 :
6892 : /* "scipy/linalg/_decomp_update.pyx":149
6893 : * elif blas_t is float_complex:
6894 : * c[0] = 0. # init imag
6895 : * lapack_pointers.clartg(a, b, <float*>c, s, &g) # <<<<<<<<<<<<<<
6896 : * else:
6897 : * c[0] = 0. # init imag
6898 : */
6899 19739 : __pyx_f_5scipy_6linalg_13cython_lapack_clartg(__pyx_v_a, __pyx_v_b, ((float *)__pyx_v_c), __pyx_v_s, (&__pyx_v_g));
6900 :
6901 : /* "scipy/linalg/_decomp_update.pyx":154
6902 : * lapack_pointers.zlartg(a, b, <double*>c, s, &g)
6903 : * # make this function more like the BLAS drotg
6904 : * a[0] = g # <<<<<<<<<<<<<<
6905 : * b[0] = 0
6906 : *
6907 : */
6908 19739 : (__pyx_v_a[0]) = __pyx_v_g;
6909 :
6910 : /* "scipy/linalg/_decomp_update.pyx":155
6911 : * # make this function more like the BLAS drotg
6912 : * a[0] = g
6913 : * b[0] = 0 # <<<<<<<<<<<<<<
6914 : *
6915 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy,
6916 : */
6917 19739 : (__pyx_v_b[0]) = __pyx_t_float_complex_from_parts(0, 0);
6918 :
6919 : /* "scipy/linalg/_decomp_update.pyx":141
6920 : * return blas_pointers.dznrm2(&n, x, &incx)
6921 : *
6922 : * cdef inline void lartg(blas_t* a, blas_t* b, blas_t* c, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
6923 : * cdef blas_t g
6924 : * if blas_t is float:
6925 : */
6926 :
6927 : /* function exit code */
6928 19739 : }
6929 :
6930 20287 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_t_double_complex *__pyx_v_a, __pyx_t_double_complex *__pyx_v_b, __pyx_t_double_complex *__pyx_v_c, __pyx_t_double_complex *__pyx_v_s) {
6931 20287 : __pyx_t_double_complex __pyx_v_g;
6932 :
6933 : /* "scipy/linalg/_decomp_update.pyx":151
6934 : * lapack_pointers.clartg(a, b, <float*>c, s, &g)
6935 : * else:
6936 : * c[0] = 0. # init imag # <<<<<<<<<<<<<<
6937 : * lapack_pointers.zlartg(a, b, <double*>c, s, &g)
6938 : * # make this function more like the BLAS drotg
6939 : */
6940 20287 : (__pyx_v_c[0]) = __pyx_t_double_complex_from_parts(0., 0);
6941 :
6942 : /* "scipy/linalg/_decomp_update.pyx":152
6943 : * else:
6944 : * c[0] = 0. # init imag
6945 : * lapack_pointers.zlartg(a, b, <double*>c, s, &g) # <<<<<<<<<<<<<<
6946 : * # make this function more like the BLAS drotg
6947 : * a[0] = g
6948 : */
6949 20287 : __pyx_f_5scipy_6linalg_13cython_lapack_zlartg(__pyx_v_a, __pyx_v_b, ((double *)__pyx_v_c), __pyx_v_s, (&__pyx_v_g));
6950 :
6951 : /* "scipy/linalg/_decomp_update.pyx":154
6952 : * lapack_pointers.zlartg(a, b, <double*>c, s, &g)
6953 : * # make this function more like the BLAS drotg
6954 : * a[0] = g # <<<<<<<<<<<<<<
6955 : * b[0] = 0
6956 : *
6957 : */
6958 20287 : (__pyx_v_a[0]) = __pyx_v_g;
6959 :
6960 : /* "scipy/linalg/_decomp_update.pyx":155
6961 : * # make this function more like the BLAS drotg
6962 : * a[0] = g
6963 : * b[0] = 0 # <<<<<<<<<<<<<<
6964 : *
6965 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy,
6966 : */
6967 20287 : (__pyx_v_b[0]) = __pyx_t_double_complex_from_parts(0, 0);
6968 :
6969 : /* "scipy/linalg/_decomp_update.pyx":141
6970 : * return blas_pointers.dznrm2(&n, x, &incx)
6971 : *
6972 : * cdef inline void lartg(blas_t* a, blas_t* b, blas_t* c, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
6973 : * cdef blas_t g
6974 : * if blas_t is float:
6975 : */
6976 :
6977 : /* function exit code */
6978 20287 : }
6979 :
6980 : /* "scipy/linalg/_decomp_update.pyx":157
6981 : * b[0] = 0
6982 : *
6983 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy, # <<<<<<<<<<<<<<
6984 : * blas_t c, blas_t s) noexcept nogil:
6985 : * if blas_t is float:
6986 : */
6987 :
6988 43151 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(int __pyx_v_n, float *__pyx_v_x, int __pyx_v_incx, float *__pyx_v_y, int __pyx_v_incy, float __pyx_v_c, float __pyx_v_s) {
6989 :
6990 : /* "scipy/linalg/_decomp_update.pyx":160
6991 : * blas_t c, blas_t s) noexcept nogil:
6992 : * if blas_t is float:
6993 : * blas_pointers.srot(&n, x, &incx, y, &incy, &c, &s) # <<<<<<<<<<<<<<
6994 : * elif blas_t is double:
6995 : * blas_pointers.drot(&n, x, &incx, y, &incy, &c, &s)
6996 : */
6997 43151 : __pyx_f_5scipy_6linalg_11cython_blas_srot((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), (&__pyx_v_c), (&__pyx_v_s));
6998 :
6999 : /* "scipy/linalg/_decomp_update.pyx":157
7000 : * b[0] = 0
7001 : *
7002 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy, # <<<<<<<<<<<<<<
7003 : * blas_t c, blas_t s) noexcept nogil:
7004 : * if blas_t is float:
7005 : */
7006 :
7007 : /* function exit code */
7008 : }
7009 :
7010 59397 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(int __pyx_v_n, double *__pyx_v_x, int __pyx_v_incx, double *__pyx_v_y, int __pyx_v_incy, double __pyx_v_c, double __pyx_v_s) {
7011 :
7012 : /* "scipy/linalg/_decomp_update.pyx":162
7013 : * blas_pointers.srot(&n, x, &incx, y, &incy, &c, &s)
7014 : * elif blas_t is double:
7015 : * blas_pointers.drot(&n, x, &incx, y, &incy, &c, &s) # <<<<<<<<<<<<<<
7016 : * elif blas_t is float_complex:
7017 : * lapack_pointers.crot(&n, x, &incx, y, &incy, <float*>&c, &s)
7018 : */
7019 59397 : __pyx_f_5scipy_6linalg_11cython_blas_drot((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), (&__pyx_v_c), (&__pyx_v_s));
7020 :
7021 : /* "scipy/linalg/_decomp_update.pyx":157
7022 : * b[0] = 0
7023 : *
7024 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy, # <<<<<<<<<<<<<<
7025 : * blas_t c, blas_t s) noexcept nogil:
7026 : * if blas_t is float:
7027 : */
7028 :
7029 : /* function exit code */
7030 : }
7031 :
7032 43151 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(int __pyx_v_n, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_float_complex *__pyx_v_y, int __pyx_v_incy, __pyx_t_float_complex __pyx_v_c, __pyx_t_float_complex __pyx_v_s) {
7033 :
7034 : /* "scipy/linalg/_decomp_update.pyx":164
7035 : * blas_pointers.drot(&n, x, &incx, y, &incy, &c, &s)
7036 : * elif blas_t is float_complex:
7037 : * lapack_pointers.crot(&n, x, &incx, y, &incy, <float*>&c, &s) # <<<<<<<<<<<<<<
7038 : * else:
7039 : * lapack_pointers.zrot(&n, x, &incx, y, &incy, <double*>&c, &s)
7040 : */
7041 43151 : __pyx_f_5scipy_6linalg_13cython_lapack_crot((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), ((float *)(&__pyx_v_c)), (&__pyx_v_s));
7042 :
7043 : /* "scipy/linalg/_decomp_update.pyx":157
7044 : * b[0] = 0
7045 : *
7046 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy, # <<<<<<<<<<<<<<
7047 : * blas_t c, blas_t s) noexcept nogil:
7048 : * if blas_t is float:
7049 : */
7050 :
7051 : /* function exit code */
7052 : }
7053 :
7054 43699 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(int __pyx_v_n, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_double_complex *__pyx_v_y, int __pyx_v_incy, __pyx_t_double_complex __pyx_v_c, __pyx_t_double_complex __pyx_v_s) {
7055 :
7056 : /* "scipy/linalg/_decomp_update.pyx":166
7057 : * lapack_pointers.crot(&n, x, &incx, y, &incy, <float*>&c, &s)
7058 : * else:
7059 : * lapack_pointers.zrot(&n, x, &incx, y, &incy, <double*>&c, &s) # <<<<<<<<<<<<<<
7060 : *
7061 : * cdef inline void larfg(int n, blas_t* alpha, blas_t* x, int incx,
7062 : */
7063 43699 : __pyx_f_5scipy_6linalg_13cython_lapack_zrot((&__pyx_v_n), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), ((double *)(&__pyx_v_c)), (&__pyx_v_s));
7064 :
7065 : /* "scipy/linalg/_decomp_update.pyx":157
7066 : * b[0] = 0
7067 : *
7068 : * cdef inline void rot(int n, blas_t* x, int incx, blas_t* y, int incy, # <<<<<<<<<<<<<<
7069 : * blas_t c, blas_t s) noexcept nogil:
7070 : * if blas_t is float:
7071 : */
7072 :
7073 : /* function exit code */
7074 : }
7075 :
7076 : /* "scipy/linalg/_decomp_update.pyx":168
7077 : * lapack_pointers.zrot(&n, x, &incx, y, &incy, <double*>&c, &s)
7078 : *
7079 : * cdef inline void larfg(int n, blas_t* alpha, blas_t* x, int incx, # <<<<<<<<<<<<<<
7080 : * blas_t* tau) noexcept nogil:
7081 : * if blas_t is float:
7082 : */
7083 :
7084 3278 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int __pyx_v_n, float *__pyx_v_alpha, float *__pyx_v_x, int __pyx_v_incx, float *__pyx_v_tau) {
7085 :
7086 : /* "scipy/linalg/_decomp_update.pyx":171
7087 : * blas_t* tau) noexcept nogil:
7088 : * if blas_t is float:
7089 : * lapack_pointers.slarfg(&n, alpha, x, &incx, tau) # <<<<<<<<<<<<<<
7090 : * elif blas_t is double:
7091 : * lapack_pointers.dlarfg(&n, alpha, x, &incx, tau)
7092 : */
7093 3278 : __pyx_f_5scipy_6linalg_13cython_lapack_slarfg((&__pyx_v_n), __pyx_v_alpha, __pyx_v_x, (&__pyx_v_incx), __pyx_v_tau);
7094 :
7095 : /* "scipy/linalg/_decomp_update.pyx":168
7096 : * lapack_pointers.zrot(&n, x, &incx, y, &incy, <double*>&c, &s)
7097 : *
7098 : * cdef inline void larfg(int n, blas_t* alpha, blas_t* x, int incx, # <<<<<<<<<<<<<<
7099 : * blas_t* tau) noexcept nogil:
7100 : * if blas_t is float:
7101 : */
7102 :
7103 : /* function exit code */
7104 : }
7105 :
7106 3278 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int __pyx_v_n, double *__pyx_v_alpha, double *__pyx_v_x, int __pyx_v_incx, double *__pyx_v_tau) {
7107 :
7108 : /* "scipy/linalg/_decomp_update.pyx":173
7109 : * lapack_pointers.slarfg(&n, alpha, x, &incx, tau)
7110 : * elif blas_t is double:
7111 : * lapack_pointers.dlarfg(&n, alpha, x, &incx, tau) # <<<<<<<<<<<<<<
7112 : * elif blas_t is float_complex:
7113 : * lapack_pointers.clarfg(&n, alpha, x, &incx, tau)
7114 : */
7115 3278 : __pyx_f_5scipy_6linalg_13cython_lapack_dlarfg((&__pyx_v_n), __pyx_v_alpha, __pyx_v_x, (&__pyx_v_incx), __pyx_v_tau);
7116 :
7117 : /* "scipy/linalg/_decomp_update.pyx":168
7118 : * lapack_pointers.zrot(&n, x, &incx, y, &incy, <double*>&c, &s)
7119 : *
7120 : * cdef inline void larfg(int n, blas_t* alpha, blas_t* x, int incx, # <<<<<<<<<<<<<<
7121 : * blas_t* tau) noexcept nogil:
7122 : * if blas_t is float:
7123 : */
7124 :
7125 : /* function exit code */
7126 : }
7127 :
7128 3278 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int __pyx_v_n, __pyx_t_float_complex *__pyx_v_alpha, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_float_complex *__pyx_v_tau) {
7129 :
7130 : /* "scipy/linalg/_decomp_update.pyx":175
7131 : * lapack_pointers.dlarfg(&n, alpha, x, &incx, tau)
7132 : * elif blas_t is float_complex:
7133 : * lapack_pointers.clarfg(&n, alpha, x, &incx, tau) # <<<<<<<<<<<<<<
7134 : * else: # blas_t is double_complex:
7135 : * lapack_pointers.zlarfg(&n, alpha, x, &incx, tau)
7136 : */
7137 3278 : __pyx_f_5scipy_6linalg_13cython_lapack_clarfg((&__pyx_v_n), __pyx_v_alpha, __pyx_v_x, (&__pyx_v_incx), __pyx_v_tau);
7138 :
7139 : /* "scipy/linalg/_decomp_update.pyx":168
7140 : * lapack_pointers.zrot(&n, x, &incx, y, &incy, <double*>&c, &s)
7141 : *
7142 : * cdef inline void larfg(int n, blas_t* alpha, blas_t* x, int incx, # <<<<<<<<<<<<<<
7143 : * blas_t* tau) noexcept nogil:
7144 : * if blas_t is float:
7145 : */
7146 :
7147 : /* function exit code */
7148 : }
7149 :
7150 3278 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larfg(int __pyx_v_n, __pyx_t_double_complex *__pyx_v_alpha, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_double_complex *__pyx_v_tau) {
7151 :
7152 : /* "scipy/linalg/_decomp_update.pyx":177
7153 : * lapack_pointers.clarfg(&n, alpha, x, &incx, tau)
7154 : * else: # blas_t is double_complex:
7155 : * lapack_pointers.zlarfg(&n, alpha, x, &incx, tau) # <<<<<<<<<<<<<<
7156 : *
7157 : * cdef inline void larf(char* side, int m, int n, blas_t* v, int incv, blas_t tau,
7158 : */
7159 3278 : __pyx_f_5scipy_6linalg_13cython_lapack_zlarfg((&__pyx_v_n), __pyx_v_alpha, __pyx_v_x, (&__pyx_v_incx), __pyx_v_tau);
7160 :
7161 : /* "scipy/linalg/_decomp_update.pyx":168
7162 : * lapack_pointers.zrot(&n, x, &incx, y, &incy, <double*>&c, &s)
7163 : *
7164 : * cdef inline void larfg(int n, blas_t* alpha, blas_t* x, int incx, # <<<<<<<<<<<<<<
7165 : * blas_t* tau) noexcept nogil:
7166 : * if blas_t is float:
7167 : */
7168 :
7169 : /* function exit code */
7170 : }
7171 :
7172 : /* "scipy/linalg/_decomp_update.pyx":179
7173 : * lapack_pointers.zlarfg(&n, alpha, x, &incx, tau)
7174 : *
7175 : * cdef inline void larf(char* side, int m, int n, blas_t* v, int incv, blas_t tau, # <<<<<<<<<<<<<<
7176 : * blas_t* c, int ldc, blas_t* work) noexcept nogil:
7177 : * if blas_t is float:
7178 : */
7179 :
7180 6187 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *__pyx_v_side, int __pyx_v_m, int __pyx_v_n, float *__pyx_v_v, int __pyx_v_incv, float __pyx_v_tau, float *__pyx_v_c, int __pyx_v_ldc, float *__pyx_v_work) {
7181 :
7182 : /* "scipy/linalg/_decomp_update.pyx":182
7183 : * blas_t* c, int ldc, blas_t* work) noexcept nogil:
7184 : * if blas_t is float:
7185 : * lapack_pointers.slarf(side, &m, &n, v, &incv, &tau, c, &ldc, work) # <<<<<<<<<<<<<<
7186 : * elif blas_t is double:
7187 : * lapack_pointers.dlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7188 : */
7189 6187 : __pyx_f_5scipy_6linalg_13cython_lapack_slarf(__pyx_v_side, (&__pyx_v_m), (&__pyx_v_n), __pyx_v_v, (&__pyx_v_incv), (&__pyx_v_tau), __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work);
7190 :
7191 : /* "scipy/linalg/_decomp_update.pyx":179
7192 : * lapack_pointers.zlarfg(&n, alpha, x, &incx, tau)
7193 : *
7194 : * cdef inline void larf(char* side, int m, int n, blas_t* v, int incv, blas_t tau, # <<<<<<<<<<<<<<
7195 : * blas_t* c, int ldc, blas_t* work) noexcept nogil:
7196 : * if blas_t is float:
7197 : */
7198 :
7199 : /* function exit code */
7200 : }
7201 :
7202 6187 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *__pyx_v_side, int __pyx_v_m, int __pyx_v_n, double *__pyx_v_v, int __pyx_v_incv, double __pyx_v_tau, double *__pyx_v_c, int __pyx_v_ldc, double *__pyx_v_work) {
7203 :
7204 : /* "scipy/linalg/_decomp_update.pyx":184
7205 : * lapack_pointers.slarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7206 : * elif blas_t is double:
7207 : * lapack_pointers.dlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work) # <<<<<<<<<<<<<<
7208 : * elif blas_t is float_complex:
7209 : * lapack_pointers.clarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7210 : */
7211 6187 : __pyx_f_5scipy_6linalg_13cython_lapack_dlarf(__pyx_v_side, (&__pyx_v_m), (&__pyx_v_n), __pyx_v_v, (&__pyx_v_incv), (&__pyx_v_tau), __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work);
7212 :
7213 : /* "scipy/linalg/_decomp_update.pyx":179
7214 : * lapack_pointers.zlarfg(&n, alpha, x, &incx, tau)
7215 : *
7216 : * cdef inline void larf(char* side, int m, int n, blas_t* v, int incv, blas_t tau, # <<<<<<<<<<<<<<
7217 : * blas_t* c, int ldc, blas_t* work) noexcept nogil:
7218 : * if blas_t is float:
7219 : */
7220 :
7221 : /* function exit code */
7222 : }
7223 :
7224 6187 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *__pyx_v_side, int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_v, int __pyx_v_incv, __pyx_t_float_complex __pyx_v_tau, __pyx_t_float_complex *__pyx_v_c, int __pyx_v_ldc, __pyx_t_float_complex *__pyx_v_work) {
7225 :
7226 : /* "scipy/linalg/_decomp_update.pyx":186
7227 : * lapack_pointers.dlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7228 : * elif blas_t is float_complex:
7229 : * lapack_pointers.clarf(side, &m, &n, v, &incv, &tau, c, &ldc, work) # <<<<<<<<<<<<<<
7230 : * else: # blas_t is double_complex:
7231 : * lapack_pointers.zlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7232 : */
7233 6187 : __pyx_f_5scipy_6linalg_13cython_lapack_clarf(__pyx_v_side, (&__pyx_v_m), (&__pyx_v_n), __pyx_v_v, (&__pyx_v_incv), (&__pyx_v_tau), __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work);
7234 :
7235 : /* "scipy/linalg/_decomp_update.pyx":179
7236 : * lapack_pointers.zlarfg(&n, alpha, x, &incx, tau)
7237 : *
7238 : * cdef inline void larf(char* side, int m, int n, blas_t* v, int incv, blas_t tau, # <<<<<<<<<<<<<<
7239 : * blas_t* c, int ldc, blas_t* work) noexcept nogil:
7240 : * if blas_t is float:
7241 : */
7242 :
7243 : /* function exit code */
7244 : }
7245 :
7246 6187 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larf(char *__pyx_v_side, int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_v, int __pyx_v_incv, __pyx_t_double_complex __pyx_v_tau, __pyx_t_double_complex *__pyx_v_c, int __pyx_v_ldc, __pyx_t_double_complex *__pyx_v_work) {
7247 :
7248 : /* "scipy/linalg/_decomp_update.pyx":188
7249 : * lapack_pointers.clarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7250 : * else: # blas_t is double_complex:
7251 : * lapack_pointers.zlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work) # <<<<<<<<<<<<<<
7252 : *
7253 : * cdef inline void ger(int m, int n, blas_t alpha, blas_t* x, int incx, blas_t* y,
7254 : */
7255 6187 : __pyx_f_5scipy_6linalg_13cython_lapack_zlarf(__pyx_v_side, (&__pyx_v_m), (&__pyx_v_n), __pyx_v_v, (&__pyx_v_incv), (&__pyx_v_tau), __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work);
7256 :
7257 : /* "scipy/linalg/_decomp_update.pyx":179
7258 : * lapack_pointers.zlarfg(&n, alpha, x, &incx, tau)
7259 : *
7260 : * cdef inline void larf(char* side, int m, int n, blas_t* v, int incv, blas_t tau, # <<<<<<<<<<<<<<
7261 : * blas_t* c, int ldc, blas_t* work) noexcept nogil:
7262 : * if blas_t is float:
7263 : */
7264 :
7265 : /* function exit code */
7266 : }
7267 :
7268 : /* "scipy/linalg/_decomp_update.pyx":190
7269 : * lapack_pointers.zlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7270 : *
7271 : * cdef inline void ger(int m, int n, blas_t alpha, blas_t* x, int incx, blas_t* y, # <<<<<<<<<<<<<<
7272 : * int incy, blas_t* a, int lda) noexcept nogil:
7273 : * if blas_t is float:
7274 : */
7275 :
7276 106 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ger(int __pyx_v_m, int __pyx_v_n, float __pyx_v_alpha, float *__pyx_v_x, int __pyx_v_incx, float *__pyx_v_y, int __pyx_v_incy, float *__pyx_v_a, int __pyx_v_lda) {
7277 :
7278 : /* "scipy/linalg/_decomp_update.pyx":193
7279 : * int incy, blas_t* a, int lda) noexcept nogil:
7280 : * if blas_t is float:
7281 : * blas_pointers.sger(&m, &n, &alpha, x, &incx, y, &incy, a, &lda) # <<<<<<<<<<<<<<
7282 : * elif blas_t is double:
7283 : * blas_pointers.dger(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7284 : */
7285 106 : __pyx_f_5scipy_6linalg_11cython_blas_sger((&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), __pyx_v_a, (&__pyx_v_lda));
7286 :
7287 : /* "scipy/linalg/_decomp_update.pyx":190
7288 : * lapack_pointers.zlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7289 : *
7290 : * cdef inline void ger(int m, int n, blas_t alpha, blas_t* x, int incx, blas_t* y, # <<<<<<<<<<<<<<
7291 : * int incy, blas_t* a, int lda) noexcept nogil:
7292 : * if blas_t is float:
7293 : */
7294 :
7295 : /* function exit code */
7296 : }
7297 :
7298 106 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ger(int __pyx_v_m, int __pyx_v_n, double __pyx_v_alpha, double *__pyx_v_x, int __pyx_v_incx, double *__pyx_v_y, int __pyx_v_incy, double *__pyx_v_a, int __pyx_v_lda) {
7299 :
7300 : /* "scipy/linalg/_decomp_update.pyx":195
7301 : * blas_pointers.sger(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7302 : * elif blas_t is double:
7303 : * blas_pointers.dger(&m, &n, &alpha, x, &incx, y, &incy, a, &lda) # <<<<<<<<<<<<<<
7304 : * elif blas_t is float_complex:
7305 : * blas_pointers.cgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7306 : */
7307 106 : __pyx_f_5scipy_6linalg_11cython_blas_dger((&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), __pyx_v_a, (&__pyx_v_lda));
7308 :
7309 : /* "scipy/linalg/_decomp_update.pyx":190
7310 : * lapack_pointers.zlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7311 : *
7312 : * cdef inline void ger(int m, int n, blas_t alpha, blas_t* x, int incx, blas_t* y, # <<<<<<<<<<<<<<
7313 : * int incy, blas_t* a, int lda) noexcept nogil:
7314 : * if blas_t is float:
7315 : */
7316 :
7317 : /* function exit code */
7318 : }
7319 :
7320 106 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ger(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex __pyx_v_alpha, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_float_complex *__pyx_v_y, int __pyx_v_incy, __pyx_t_float_complex *__pyx_v_a, int __pyx_v_lda) {
7321 :
7322 : /* "scipy/linalg/_decomp_update.pyx":197
7323 : * blas_pointers.dger(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7324 : * elif blas_t is float_complex:
7325 : * blas_pointers.cgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda) # <<<<<<<<<<<<<<
7326 : * else:
7327 : * blas_pointers.zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7328 : */
7329 106 : __pyx_f_5scipy_6linalg_11cython_blas_cgeru((&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), __pyx_v_a, (&__pyx_v_lda));
7330 :
7331 : /* "scipy/linalg/_decomp_update.pyx":190
7332 : * lapack_pointers.zlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7333 : *
7334 : * cdef inline void ger(int m, int n, blas_t alpha, blas_t* x, int incx, blas_t* y, # <<<<<<<<<<<<<<
7335 : * int incy, blas_t* a, int lda) noexcept nogil:
7336 : * if blas_t is float:
7337 : */
7338 :
7339 : /* function exit code */
7340 : }
7341 :
7342 106 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ger(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex __pyx_v_alpha, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_double_complex *__pyx_v_y, int __pyx_v_incy, __pyx_t_double_complex *__pyx_v_a, int __pyx_v_lda) {
7343 :
7344 : /* "scipy/linalg/_decomp_update.pyx":199
7345 : * blas_pointers.cgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7346 : * else:
7347 : * blas_pointers.zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda) # <<<<<<<<<<<<<<
7348 : *
7349 : * cdef inline void gemv(char* trans, int m, int n, blas_t alpha, blas_t* a,
7350 : */
7351 106 : __pyx_f_5scipy_6linalg_11cython_blas_zgeru((&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_x, (&__pyx_v_incx), __pyx_v_y, (&__pyx_v_incy), __pyx_v_a, (&__pyx_v_lda));
7352 :
7353 : /* "scipy/linalg/_decomp_update.pyx":190
7354 : * lapack_pointers.zlarf(side, &m, &n, v, &incv, &tau, c, &ldc, work)
7355 : *
7356 : * cdef inline void ger(int m, int n, blas_t alpha, blas_t* x, int incx, blas_t* y, # <<<<<<<<<<<<<<
7357 : * int incy, blas_t* a, int lda) noexcept nogil:
7358 : * if blas_t is float:
7359 : */
7360 :
7361 : /* function exit code */
7362 : }
7363 :
7364 : /* "scipy/linalg/_decomp_update.pyx":201
7365 : * blas_pointers.zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7366 : *
7367 : * cdef inline void gemv(char* trans, int m, int n, blas_t alpha, blas_t* a, # <<<<<<<<<<<<<<
7368 : * int lda, blas_t* x, int incx, blas_t beta, blas_t* y, int incy) noexcept nogil:
7369 : * if blas_t is float:
7370 : */
7371 :
7372 1906 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, float __pyx_v_alpha, float *__pyx_v_a, int __pyx_v_lda, float *__pyx_v_x, int __pyx_v_incx, float __pyx_v_beta, float *__pyx_v_y, int __pyx_v_incy) {
7373 :
7374 : /* "scipy/linalg/_decomp_update.pyx":204
7375 : * int lda, blas_t* x, int incx, blas_t beta, blas_t* y, int incy) noexcept nogil:
7376 : * if blas_t is float:
7377 : * blas_pointers.sgemv(trans, &m, &n, &alpha, a, &lda, x, &incx, # <<<<<<<<<<<<<<
7378 : * &beta, y, &incy)
7379 : * elif blas_t is double:
7380 : */
7381 1906 : __pyx_f_5scipy_6linalg_11cython_blas_sgemv(__pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_x, (&__pyx_v_incx), (&__pyx_v_beta), __pyx_v_y, (&__pyx_v_incy));
7382 :
7383 : /* "scipy/linalg/_decomp_update.pyx":201
7384 : * blas_pointers.zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7385 : *
7386 : * cdef inline void gemv(char* trans, int m, int n, blas_t alpha, blas_t* a, # <<<<<<<<<<<<<<
7387 : * int lda, blas_t* x, int incx, blas_t beta, blas_t* y, int incy) noexcept nogil:
7388 : * if blas_t is float:
7389 : */
7390 :
7391 : /* function exit code */
7392 : }
7393 :
7394 18152 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, double __pyx_v_alpha, double *__pyx_v_a, int __pyx_v_lda, double *__pyx_v_x, int __pyx_v_incx, double __pyx_v_beta, double *__pyx_v_y, int __pyx_v_incy) {
7395 :
7396 : /* "scipy/linalg/_decomp_update.pyx":207
7397 : * &beta, y, &incy)
7398 : * elif blas_t is double:
7399 : * blas_pointers.dgemv(trans, &m, &n, &alpha, a, &lda, x, &incx, # <<<<<<<<<<<<<<
7400 : * &beta, y, &incy)
7401 : * elif blas_t is float_complex:
7402 : */
7403 18152 : __pyx_f_5scipy_6linalg_11cython_blas_dgemv(__pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_x, (&__pyx_v_incx), (&__pyx_v_beta), __pyx_v_y, (&__pyx_v_incy));
7404 :
7405 : /* "scipy/linalg/_decomp_update.pyx":201
7406 : * blas_pointers.zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7407 : *
7408 : * cdef inline void gemv(char* trans, int m, int n, blas_t alpha, blas_t* a, # <<<<<<<<<<<<<<
7409 : * int lda, blas_t* x, int incx, blas_t beta, blas_t* y, int incy) noexcept nogil:
7410 : * if blas_t is float:
7411 : */
7412 :
7413 : /* function exit code */
7414 : }
7415 :
7416 1926 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex __pyx_v_alpha, __pyx_t_float_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_float_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_float_complex __pyx_v_beta, __pyx_t_float_complex *__pyx_v_y, int __pyx_v_incy) {
7417 :
7418 : /* "scipy/linalg/_decomp_update.pyx":210
7419 : * &beta, y, &incy)
7420 : * elif blas_t is float_complex:
7421 : * blas_pointers.cgemv(trans, &m, &n, &alpha, a, &lda, x, &incx, # <<<<<<<<<<<<<<
7422 : * &beta, y, &incy)
7423 : * else: # blas_t is double_complex:
7424 : */
7425 1926 : __pyx_f_5scipy_6linalg_11cython_blas_cgemv(__pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_x, (&__pyx_v_incx), (&__pyx_v_beta), __pyx_v_y, (&__pyx_v_incy));
7426 :
7427 : /* "scipy/linalg/_decomp_update.pyx":201
7428 : * blas_pointers.zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7429 : *
7430 : * cdef inline void gemv(char* trans, int m, int n, blas_t alpha, blas_t* a, # <<<<<<<<<<<<<<
7431 : * int lda, blas_t* x, int incx, blas_t beta, blas_t* y, int incy) noexcept nogil:
7432 : * if blas_t is float:
7433 : */
7434 :
7435 : /* function exit code */
7436 : }
7437 :
7438 2474 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex __pyx_v_alpha, __pyx_t_double_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_double_complex *__pyx_v_x, int __pyx_v_incx, __pyx_t_double_complex __pyx_v_beta, __pyx_t_double_complex *__pyx_v_y, int __pyx_v_incy) {
7439 :
7440 : /* "scipy/linalg/_decomp_update.pyx":213
7441 : * &beta, y, &incy)
7442 : * else: # blas_t is double_complex:
7443 : * blas_pointers.zgemv(trans, &m, &n, &alpha, a, &lda, x, &incx, # <<<<<<<<<<<<<<
7444 : * &beta, y, &incy)
7445 : *
7446 : */
7447 2474 : __pyx_f_5scipy_6linalg_11cython_blas_zgemv(__pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_x, (&__pyx_v_incx), (&__pyx_v_beta), __pyx_v_y, (&__pyx_v_incy));
7448 :
7449 : /* "scipy/linalg/_decomp_update.pyx":201
7450 : * blas_pointers.zgeru(&m, &n, &alpha, x, &incx, y, &incy, a, &lda)
7451 : *
7452 : * cdef inline void gemv(char* trans, int m, int n, blas_t alpha, blas_t* a, # <<<<<<<<<<<<<<
7453 : * int lda, blas_t* x, int incx, blas_t beta, blas_t* y, int incy) noexcept nogil:
7454 : * if blas_t is float:
7455 : */
7456 :
7457 : /* function exit code */
7458 : }
7459 :
7460 : /* "scipy/linalg/_decomp_update.pyx":216
7461 : * &beta, y, &incy)
7462 : *
7463 : * cdef inline void gemm(char* transa, char* transb, int m, int n, int k, # <<<<<<<<<<<<<<
7464 : * blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb, blas_t beta,
7465 : * blas_t* c, int ldc) noexcept nogil:
7466 : */
7467 :
7468 377 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *__pyx_v_transa, char *__pyx_v_transb, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, float __pyx_v_alpha, float *__pyx_v_a, int __pyx_v_lda, float *__pyx_v_b, int __pyx_v_ldb, float __pyx_v_beta, float *__pyx_v_c, int __pyx_v_ldc) {
7469 :
7470 : /* "scipy/linalg/_decomp_update.pyx":220
7471 : * blas_t* c, int ldc) noexcept nogil:
7472 : * if blas_t is float:
7473 : * blas_pointers.sgemm(transa, transb, &m, &n, &k, &alpha, a, &lda, # <<<<<<<<<<<<<<
7474 : * b, &ldb, &beta, c, &ldc)
7475 : * elif blas_t is double:
7476 : */
7477 377 : __pyx_f_5scipy_6linalg_11cython_blas_sgemm(__pyx_v_transa, __pyx_v_transb, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb), (&__pyx_v_beta), __pyx_v_c, (&__pyx_v_ldc));
7478 :
7479 : /* "scipy/linalg/_decomp_update.pyx":216
7480 : * &beta, y, &incy)
7481 : *
7482 : * cdef inline void gemm(char* transa, char* transb, int m, int n, int k, # <<<<<<<<<<<<<<
7483 : * blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb, blas_t beta,
7484 : * blas_t* c, int ldc) noexcept nogil:
7485 : */
7486 :
7487 : /* function exit code */
7488 : }
7489 :
7490 377 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *__pyx_v_transa, char *__pyx_v_transb, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, double __pyx_v_alpha, double *__pyx_v_a, int __pyx_v_lda, double *__pyx_v_b, int __pyx_v_ldb, double __pyx_v_beta, double *__pyx_v_c, int __pyx_v_ldc) {
7491 :
7492 : /* "scipy/linalg/_decomp_update.pyx":223
7493 : * b, &ldb, &beta, c, &ldc)
7494 : * elif blas_t is double:
7495 : * blas_pointers.dgemm(transa, transb, &m, &n, &k, &alpha, a, &lda, # <<<<<<<<<<<<<<
7496 : * b, &ldb, &beta, c, &ldc)
7497 : * elif blas_t is float_complex:
7498 : */
7499 377 : __pyx_f_5scipy_6linalg_11cython_blas_dgemm(__pyx_v_transa, __pyx_v_transb, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb), (&__pyx_v_beta), __pyx_v_c, (&__pyx_v_ldc));
7500 :
7501 : /* "scipy/linalg/_decomp_update.pyx":216
7502 : * &beta, y, &incy)
7503 : *
7504 : * cdef inline void gemm(char* transa, char* transb, int m, int n, int k, # <<<<<<<<<<<<<<
7505 : * blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb, blas_t beta,
7506 : * blas_t* c, int ldc) noexcept nogil:
7507 : */
7508 :
7509 : /* function exit code */
7510 : }
7511 :
7512 377 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *__pyx_v_transa, char *__pyx_v_transb, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, __pyx_t_float_complex __pyx_v_alpha, __pyx_t_float_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_float_complex *__pyx_v_b, int __pyx_v_ldb, __pyx_t_float_complex __pyx_v_beta, __pyx_t_float_complex *__pyx_v_c, int __pyx_v_ldc) {
7513 :
7514 : /* "scipy/linalg/_decomp_update.pyx":226
7515 : * b, &ldb, &beta, c, &ldc)
7516 : * elif blas_t is float_complex:
7517 : * blas_pointers.cgemm(transa, transb, &m, &n, &k, &alpha, a, &lda, # <<<<<<<<<<<<<<
7518 : * b, &ldb, &beta, c, &ldc)
7519 : * else: # blas_t is double_complex:
7520 : */
7521 377 : __pyx_f_5scipy_6linalg_11cython_blas_cgemm(__pyx_v_transa, __pyx_v_transb, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb), (&__pyx_v_beta), __pyx_v_c, (&__pyx_v_ldc));
7522 :
7523 : /* "scipy/linalg/_decomp_update.pyx":216
7524 : * &beta, y, &incy)
7525 : *
7526 : * cdef inline void gemm(char* transa, char* transb, int m, int n, int k, # <<<<<<<<<<<<<<
7527 : * blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb, blas_t beta,
7528 : * blas_t* c, int ldc) noexcept nogil:
7529 : */
7530 :
7531 : /* function exit code */
7532 : }
7533 :
7534 377 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemm(char *__pyx_v_transa, char *__pyx_v_transb, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, __pyx_t_double_complex __pyx_v_alpha, __pyx_t_double_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_double_complex *__pyx_v_b, int __pyx_v_ldb, __pyx_t_double_complex __pyx_v_beta, __pyx_t_double_complex *__pyx_v_c, int __pyx_v_ldc) {
7535 :
7536 : /* "scipy/linalg/_decomp_update.pyx":229
7537 : * b, &ldb, &beta, c, &ldc)
7538 : * else: # blas_t is double_complex:
7539 : * blas_pointers.zgemm(transa, transb, &m, &n, &k, &alpha, a, &lda, # <<<<<<<<<<<<<<
7540 : * b, &ldb, &beta, c, &ldc)
7541 : *
7542 : */
7543 377 : __pyx_f_5scipy_6linalg_11cython_blas_zgemm(__pyx_v_transa, __pyx_v_transb, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb), (&__pyx_v_beta), __pyx_v_c, (&__pyx_v_ldc));
7544 :
7545 : /* "scipy/linalg/_decomp_update.pyx":216
7546 : * &beta, y, &incy)
7547 : *
7548 : * cdef inline void gemm(char* transa, char* transb, int m, int n, int k, # <<<<<<<<<<<<<<
7549 : * blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb, blas_t beta,
7550 : * blas_t* c, int ldc) noexcept nogil:
7551 : */
7552 :
7553 : /* function exit code */
7554 : }
7555 :
7556 : /* "scipy/linalg/_decomp_update.pyx":232
7557 : * b, &ldb, &beta, c, &ldc)
7558 : *
7559 : * cdef inline void trmm(char* side, char* uplo, char* transa, char* diag, int m, # <<<<<<<<<<<<<<
7560 : * int n, blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb) noexcept nogil:
7561 : * if blas_t is float:
7562 : */
7563 :
7564 211 : static CYTHON_INLINE void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *__pyx_v_side, char *__pyx_v_uplo, char *__pyx_v_transa, char *__pyx_v_diag, int __pyx_v_m, int __pyx_v_n, float __pyx_v_alpha, float *__pyx_v_a, int __pyx_v_lda, float *__pyx_v_b, int __pyx_v_ldb) {
7565 :
7566 : /* "scipy/linalg/_decomp_update.pyx":235
7567 : * int n, blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb) noexcept nogil:
7568 : * if blas_t is float:
7569 : * blas_pointers.strmm(side, uplo, transa, diag, &m, &n, &alpha, a, &lda, # <<<<<<<<<<<<<<
7570 : * b, &ldb)
7571 : * elif blas_t is double:
7572 : */
7573 211 : __pyx_f_5scipy_6linalg_11cython_blas_strmm(__pyx_v_side, __pyx_v_uplo, __pyx_v_transa, __pyx_v_diag, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb));
7574 :
7575 : /* "scipy/linalg/_decomp_update.pyx":232
7576 : * b, &ldb, &beta, c, &ldc)
7577 : *
7578 : * cdef inline void trmm(char* side, char* uplo, char* transa, char* diag, int m, # <<<<<<<<<<<<<<
7579 : * int n, blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb) noexcept nogil:
7580 : * if blas_t is float:
7581 : */
7582 :
7583 : /* function exit code */
7584 : }
7585 :
7586 211 : static CYTHON_INLINE void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *__pyx_v_side, char *__pyx_v_uplo, char *__pyx_v_transa, char *__pyx_v_diag, int __pyx_v_m, int __pyx_v_n, double __pyx_v_alpha, double *__pyx_v_a, int __pyx_v_lda, double *__pyx_v_b, int __pyx_v_ldb) {
7587 :
7588 : /* "scipy/linalg/_decomp_update.pyx":238
7589 : * b, &ldb)
7590 : * elif blas_t is double:
7591 : * blas_pointers.dtrmm(side, uplo, transa, diag, &m, &n, &alpha, a, &lda, # <<<<<<<<<<<<<<
7592 : * b, &ldb)
7593 : * elif blas_t is float_complex:
7594 : */
7595 211 : __pyx_f_5scipy_6linalg_11cython_blas_dtrmm(__pyx_v_side, __pyx_v_uplo, __pyx_v_transa, __pyx_v_diag, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb));
7596 :
7597 : /* "scipy/linalg/_decomp_update.pyx":232
7598 : * b, &ldb, &beta, c, &ldc)
7599 : *
7600 : * cdef inline void trmm(char* side, char* uplo, char* transa, char* diag, int m, # <<<<<<<<<<<<<<
7601 : * int n, blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb) noexcept nogil:
7602 : * if blas_t is float:
7603 : */
7604 :
7605 : /* function exit code */
7606 : }
7607 :
7608 211 : static CYTHON_INLINE void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *__pyx_v_side, char *__pyx_v_uplo, char *__pyx_v_transa, char *__pyx_v_diag, int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex __pyx_v_alpha, __pyx_t_float_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_float_complex *__pyx_v_b, int __pyx_v_ldb) {
7609 :
7610 : /* "scipy/linalg/_decomp_update.pyx":241
7611 : * b, &ldb)
7612 : * elif blas_t is float_complex:
7613 : * blas_pointers.ctrmm(side, uplo, transa, diag, &m, &n, &alpha, a, &lda, # <<<<<<<<<<<<<<
7614 : * b, &ldb)
7615 : * else: # blas_t is double_complex:
7616 : */
7617 211 : __pyx_f_5scipy_6linalg_11cython_blas_ctrmm(__pyx_v_side, __pyx_v_uplo, __pyx_v_transa, __pyx_v_diag, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb));
7618 :
7619 : /* "scipy/linalg/_decomp_update.pyx":232
7620 : * b, &ldb, &beta, c, &ldc)
7621 : *
7622 : * cdef inline void trmm(char* side, char* uplo, char* transa, char* diag, int m, # <<<<<<<<<<<<<<
7623 : * int n, blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb) noexcept nogil:
7624 : * if blas_t is float:
7625 : */
7626 :
7627 : /* function exit code */
7628 : }
7629 :
7630 211 : static CYTHON_INLINE void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_trmm(char *__pyx_v_side, char *__pyx_v_uplo, char *__pyx_v_transa, char *__pyx_v_diag, int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex __pyx_v_alpha, __pyx_t_double_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_double_complex *__pyx_v_b, int __pyx_v_ldb) {
7631 :
7632 : /* "scipy/linalg/_decomp_update.pyx":244
7633 : * b, &ldb)
7634 : * else: # blas_t is double_complex:
7635 : * blas_pointers.ztrmm(side, uplo, transa, diag, &m, &n, &alpha, a, &lda, # <<<<<<<<<<<<<<
7636 : * b, &ldb)
7637 : *
7638 : */
7639 211 : __pyx_f_5scipy_6linalg_11cython_blas_ztrmm(__pyx_v_side, __pyx_v_uplo, __pyx_v_transa, __pyx_v_diag, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_alpha), __pyx_v_a, (&__pyx_v_lda), __pyx_v_b, (&__pyx_v_ldb));
7640 :
7641 : /* "scipy/linalg/_decomp_update.pyx":232
7642 : * b, &ldb, &beta, c, &ldc)
7643 : *
7644 : * cdef inline void trmm(char* side, char* uplo, char* transa, char* diag, int m, # <<<<<<<<<<<<<<
7645 : * int n, blas_t alpha, blas_t* a, int lda, blas_t* b, int ldb) noexcept nogil:
7646 : * if blas_t is float:
7647 : */
7648 :
7649 : /* function exit code */
7650 : }
7651 :
7652 : /* "scipy/linalg/_decomp_update.pyx":247
7653 : * b, &ldb)
7654 : *
7655 : * cdef inline int geqrf(int m, int n, blas_t* a, int lda, blas_t* tau, # <<<<<<<<<<<<<<
7656 : * blas_t* work, int lwork) noexcept nogil:
7657 : * cdef int info
7658 : */
7659 :
7660 186 : static CYTHON_INLINE int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_a, int __pyx_v_lda, float *__pyx_v_tau, float *__pyx_v_work, int __pyx_v_lwork) {
7661 186 : int __pyx_v_info;
7662 186 : int __pyx_r;
7663 :
7664 : /* "scipy/linalg/_decomp_update.pyx":251
7665 : * cdef int info
7666 : * if blas_t is float:
7667 : * lapack_pointers.sgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info) # <<<<<<<<<<<<<<
7668 : * elif blas_t is double:
7669 : * lapack_pointers.dgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7670 : */
7671 186 : __pyx_f_5scipy_6linalg_13cython_lapack_sgeqrf((&__pyx_v_m), (&__pyx_v_n), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7672 :
7673 : /* "scipy/linalg/_decomp_update.pyx":258
7674 : * else: # blas_t is double_complex:
7675 : * lapack_pointers.zgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7676 : * return info # <<<<<<<<<<<<<<
7677 : *
7678 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7679 : */
7680 186 : __pyx_r = __pyx_v_info;
7681 186 : goto __pyx_L0;
7682 :
7683 : /* "scipy/linalg/_decomp_update.pyx":247
7684 : * b, &ldb)
7685 : *
7686 : * cdef inline int geqrf(int m, int n, blas_t* a, int lda, blas_t* tau, # <<<<<<<<<<<<<<
7687 : * blas_t* work, int lwork) noexcept nogil:
7688 : * cdef int info
7689 : */
7690 :
7691 : /* function exit code */
7692 186 : __pyx_L0:;
7693 186 : return __pyx_r;
7694 : }
7695 :
7696 186 : static CYTHON_INLINE int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_a, int __pyx_v_lda, double *__pyx_v_tau, double *__pyx_v_work, int __pyx_v_lwork) {
7697 186 : int __pyx_v_info;
7698 186 : int __pyx_r;
7699 :
7700 : /* "scipy/linalg/_decomp_update.pyx":253
7701 : * lapack_pointers.sgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7702 : * elif blas_t is double:
7703 : * lapack_pointers.dgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info) # <<<<<<<<<<<<<<
7704 : * elif blas_t is float_complex:
7705 : * lapack_pointers.cgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7706 : */
7707 186 : __pyx_f_5scipy_6linalg_13cython_lapack_dgeqrf((&__pyx_v_m), (&__pyx_v_n), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7708 :
7709 : /* "scipy/linalg/_decomp_update.pyx":258
7710 : * else: # blas_t is double_complex:
7711 : * lapack_pointers.zgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7712 : * return info # <<<<<<<<<<<<<<
7713 : *
7714 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7715 : */
7716 186 : __pyx_r = __pyx_v_info;
7717 186 : goto __pyx_L0;
7718 :
7719 : /* "scipy/linalg/_decomp_update.pyx":247
7720 : * b, &ldb)
7721 : *
7722 : * cdef inline int geqrf(int m, int n, blas_t* a, int lda, blas_t* tau, # <<<<<<<<<<<<<<
7723 : * blas_t* work, int lwork) noexcept nogil:
7724 : * cdef int info
7725 : */
7726 :
7727 : /* function exit code */
7728 186 : __pyx_L0:;
7729 186 : return __pyx_r;
7730 : }
7731 :
7732 186 : static CYTHON_INLINE int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_float_complex *__pyx_v_tau, __pyx_t_float_complex *__pyx_v_work, int __pyx_v_lwork) {
7733 186 : int __pyx_v_info;
7734 186 : int __pyx_r;
7735 :
7736 : /* "scipy/linalg/_decomp_update.pyx":255
7737 : * lapack_pointers.dgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7738 : * elif blas_t is float_complex:
7739 : * lapack_pointers.cgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info) # <<<<<<<<<<<<<<
7740 : * else: # blas_t is double_complex:
7741 : * lapack_pointers.zgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7742 : */
7743 186 : __pyx_f_5scipy_6linalg_13cython_lapack_cgeqrf((&__pyx_v_m), (&__pyx_v_n), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7744 :
7745 : /* "scipy/linalg/_decomp_update.pyx":258
7746 : * else: # blas_t is double_complex:
7747 : * lapack_pointers.zgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7748 : * return info # <<<<<<<<<<<<<<
7749 : *
7750 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7751 : */
7752 186 : __pyx_r = __pyx_v_info;
7753 186 : goto __pyx_L0;
7754 :
7755 : /* "scipy/linalg/_decomp_update.pyx":247
7756 : * b, &ldb)
7757 : *
7758 : * cdef inline int geqrf(int m, int n, blas_t* a, int lda, blas_t* tau, # <<<<<<<<<<<<<<
7759 : * blas_t* work, int lwork) noexcept nogil:
7760 : * cdef int info
7761 : */
7762 :
7763 : /* function exit code */
7764 186 : __pyx_L0:;
7765 186 : return __pyx_r;
7766 : }
7767 :
7768 186 : static CYTHON_INLINE int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_double_complex *__pyx_v_tau, __pyx_t_double_complex *__pyx_v_work, int __pyx_v_lwork) {
7769 186 : int __pyx_v_info;
7770 186 : int __pyx_r;
7771 :
7772 : /* "scipy/linalg/_decomp_update.pyx":257
7773 : * lapack_pointers.cgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7774 : * else: # blas_t is double_complex:
7775 : * lapack_pointers.zgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info) # <<<<<<<<<<<<<<
7776 : * return info
7777 : *
7778 : */
7779 186 : __pyx_f_5scipy_6linalg_13cython_lapack_zgeqrf((&__pyx_v_m), (&__pyx_v_n), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7780 :
7781 : /* "scipy/linalg/_decomp_update.pyx":258
7782 : * else: # blas_t is double_complex:
7783 : * lapack_pointers.zgeqrf(&m, &n, a, &lda, tau, work, &lwork, &info)
7784 : * return info # <<<<<<<<<<<<<<
7785 : *
7786 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7787 : */
7788 186 : __pyx_r = __pyx_v_info;
7789 186 : goto __pyx_L0;
7790 :
7791 : /* "scipy/linalg/_decomp_update.pyx":247
7792 : * b, &ldb)
7793 : *
7794 : * cdef inline int geqrf(int m, int n, blas_t* a, int lda, blas_t* tau, # <<<<<<<<<<<<<<
7795 : * blas_t* work, int lwork) noexcept nogil:
7796 : * cdef int info
7797 : */
7798 :
7799 : /* function exit code */
7800 186 : __pyx_L0:;
7801 186 : return __pyx_r;
7802 : }
7803 :
7804 : /* "scipy/linalg/_decomp_update.pyx":260
7805 : * return info
7806 : *
7807 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a, # <<<<<<<<<<<<<<
7808 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7809 : * cdef int info = 0
7810 : */
7811 :
7812 186 : static CYTHON_INLINE int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *__pyx_v_side, char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, float *__pyx_v_a, int __pyx_v_lda, float *__pyx_v_tau, float *__pyx_v_c, int __pyx_v_ldc, float *__pyx_v_work, int __pyx_v_lwork) {
7813 186 : int __pyx_v_info;
7814 186 : int __pyx_r;
7815 :
7816 : /* "scipy/linalg/_decomp_update.pyx":262
7817 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7818 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7819 : * cdef int info = 0 # <<<<<<<<<<<<<<
7820 : * if blas_t is float:
7821 : * lapack_pointers.sormqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7822 : */
7823 186 : __pyx_v_info = 0;
7824 :
7825 : /* "scipy/linalg/_decomp_update.pyx":264
7826 : * cdef int info = 0
7827 : * if blas_t is float:
7828 : * lapack_pointers.sormqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc, # <<<<<<<<<<<<<<
7829 : * work, &lwork, &info)
7830 : * elif blas_t is double:
7831 : */
7832 186 : __pyx_f_5scipy_6linalg_13cython_lapack_sormqr(__pyx_v_side, __pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7833 :
7834 : /* "scipy/linalg/_decomp_update.pyx":275
7835 : * lapack_pointers.zunmqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7836 : * work, &lwork, &info)
7837 : * return info # <<<<<<<<<<<<<<
7838 : *
7839 : * #------------------------------------------------------------------------------
7840 : */
7841 186 : __pyx_r = __pyx_v_info;
7842 186 : goto __pyx_L0;
7843 :
7844 : /* "scipy/linalg/_decomp_update.pyx":260
7845 : * return info
7846 : *
7847 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a, # <<<<<<<<<<<<<<
7848 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7849 : * cdef int info = 0
7850 : */
7851 :
7852 : /* function exit code */
7853 186 : __pyx_L0:;
7854 186 : return __pyx_r;
7855 : }
7856 :
7857 186 : static CYTHON_INLINE int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *__pyx_v_side, char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, double *__pyx_v_a, int __pyx_v_lda, double *__pyx_v_tau, double *__pyx_v_c, int __pyx_v_ldc, double *__pyx_v_work, int __pyx_v_lwork) {
7858 186 : int __pyx_v_info;
7859 186 : int __pyx_r;
7860 :
7861 : /* "scipy/linalg/_decomp_update.pyx":262
7862 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7863 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7864 : * cdef int info = 0 # <<<<<<<<<<<<<<
7865 : * if blas_t is float:
7866 : * lapack_pointers.sormqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7867 : */
7868 186 : __pyx_v_info = 0;
7869 :
7870 : /* "scipy/linalg/_decomp_update.pyx":267
7871 : * work, &lwork, &info)
7872 : * elif blas_t is double:
7873 : * lapack_pointers.dormqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc, # <<<<<<<<<<<<<<
7874 : * work, &lwork, &info)
7875 : * elif blas_t is float_complex:
7876 : */
7877 186 : __pyx_f_5scipy_6linalg_13cython_lapack_dormqr(__pyx_v_side, __pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7878 :
7879 : /* "scipy/linalg/_decomp_update.pyx":275
7880 : * lapack_pointers.zunmqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7881 : * work, &lwork, &info)
7882 : * return info # <<<<<<<<<<<<<<
7883 : *
7884 : * #------------------------------------------------------------------------------
7885 : */
7886 186 : __pyx_r = __pyx_v_info;
7887 186 : goto __pyx_L0;
7888 :
7889 : /* "scipy/linalg/_decomp_update.pyx":260
7890 : * return info
7891 : *
7892 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a, # <<<<<<<<<<<<<<
7893 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7894 : * cdef int info = 0
7895 : */
7896 :
7897 : /* function exit code */
7898 186 : __pyx_L0:;
7899 186 : return __pyx_r;
7900 : }
7901 :
7902 186 : static CYTHON_INLINE int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *__pyx_v_side, char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, __pyx_t_float_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_float_complex *__pyx_v_tau, __pyx_t_float_complex *__pyx_v_c, int __pyx_v_ldc, __pyx_t_float_complex *__pyx_v_work, int __pyx_v_lwork) {
7903 186 : int __pyx_v_info;
7904 186 : int __pyx_r;
7905 :
7906 : /* "scipy/linalg/_decomp_update.pyx":262
7907 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7908 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7909 : * cdef int info = 0 # <<<<<<<<<<<<<<
7910 : * if blas_t is float:
7911 : * lapack_pointers.sormqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7912 : */
7913 186 : __pyx_v_info = 0;
7914 :
7915 : /* "scipy/linalg/_decomp_update.pyx":270
7916 : * work, &lwork, &info)
7917 : * elif blas_t is float_complex:
7918 : * lapack_pointers.cunmqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc, # <<<<<<<<<<<<<<
7919 : * work, &lwork, &info)
7920 : * else:
7921 : */
7922 186 : __pyx_f_5scipy_6linalg_13cython_lapack_cunmqr(__pyx_v_side, __pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7923 :
7924 : /* "scipy/linalg/_decomp_update.pyx":275
7925 : * lapack_pointers.zunmqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7926 : * work, &lwork, &info)
7927 : * return info # <<<<<<<<<<<<<<
7928 : *
7929 : * #------------------------------------------------------------------------------
7930 : */
7931 186 : __pyx_r = __pyx_v_info;
7932 186 : goto __pyx_L0;
7933 :
7934 : /* "scipy/linalg/_decomp_update.pyx":260
7935 : * return info
7936 : *
7937 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a, # <<<<<<<<<<<<<<
7938 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7939 : * cdef int info = 0
7940 : */
7941 :
7942 : /* function exit code */
7943 186 : __pyx_L0:;
7944 186 : return __pyx_r;
7945 : }
7946 :
7947 186 : static CYTHON_INLINE int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(char *__pyx_v_side, char *__pyx_v_trans, int __pyx_v_m, int __pyx_v_n, int __pyx_v_k, __pyx_t_double_complex *__pyx_v_a, int __pyx_v_lda, __pyx_t_double_complex *__pyx_v_tau, __pyx_t_double_complex *__pyx_v_c, int __pyx_v_ldc, __pyx_t_double_complex *__pyx_v_work, int __pyx_v_lwork) {
7948 186 : int __pyx_v_info;
7949 186 : int __pyx_r;
7950 :
7951 : /* "scipy/linalg/_decomp_update.pyx":262
7952 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a,
7953 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7954 : * cdef int info = 0 # <<<<<<<<<<<<<<
7955 : * if blas_t is float:
7956 : * lapack_pointers.sormqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7957 : */
7958 186 : __pyx_v_info = 0;
7959 :
7960 : /* "scipy/linalg/_decomp_update.pyx":273
7961 : * work, &lwork, &info)
7962 : * else:
7963 : * lapack_pointers.zunmqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc, # <<<<<<<<<<<<<<
7964 : * work, &lwork, &info)
7965 : * return info
7966 : */
7967 186 : __pyx_f_5scipy_6linalg_13cython_lapack_zunmqr(__pyx_v_side, __pyx_v_trans, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_k), __pyx_v_a, (&__pyx_v_lda), __pyx_v_tau, __pyx_v_c, (&__pyx_v_ldc), __pyx_v_work, (&__pyx_v_lwork), (&__pyx_v_info));
7968 :
7969 : /* "scipy/linalg/_decomp_update.pyx":275
7970 : * lapack_pointers.zunmqr(side, trans, &m, &n, &k, a, &lda, tau, c, &ldc,
7971 : * work, &lwork, &info)
7972 : * return info # <<<<<<<<<<<<<<
7973 : *
7974 : * #------------------------------------------------------------------------------
7975 : */
7976 186 : __pyx_r = __pyx_v_info;
7977 186 : goto __pyx_L0;
7978 :
7979 : /* "scipy/linalg/_decomp_update.pyx":260
7980 : * return info
7981 : *
7982 : * cdef inline int ormqr(char* side, char* trans, int m, int n, int k, blas_t* a, # <<<<<<<<<<<<<<
7983 : * int lda, blas_t* tau, blas_t* c, int ldc, blas_t* work, int lwork) noexcept nogil:
7984 : * cdef int info = 0
7985 : */
7986 :
7987 : /* function exit code */
7988 186 : __pyx_L0:;
7989 186 : return __pyx_r;
7990 : }
7991 :
7992 : /* "scipy/linalg/_decomp_update.pyx":281
7993 : * #------------------------------------------------------------------------------
7994 : *
7995 : * cdef void blas_t_conj(int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
7996 : * cdef int j
7997 : * if blas_t is float_complex or blas_t is double_complex:
7998 : */
7999 :
8000 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED float *__pyx_v_x, CYTHON_UNUSED int *__pyx_v_xs) {
8001 :
8002 : /* "scipy/linalg/_decomp_update.pyx":283
8003 : * cdef void blas_t_conj(int n, blas_t* x, int* xs) noexcept nogil:
8004 : * cdef int j
8005 : * if blas_t is float_complex or blas_t is double_complex: # <<<<<<<<<<<<<<
8006 : * for j in range(n):
8007 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8008 : */
8009 :
8010 : /* function exit code */
8011 : }
8012 :
8013 : /* "scipy/linalg/_decomp_update.pyx":281
8014 : * #------------------------------------------------------------------------------
8015 : *
8016 : * cdef void blas_t_conj(int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8017 : * cdef int j
8018 : * if blas_t is float_complex or blas_t is double_complex:
8019 : */
8020 :
8021 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED double *__pyx_v_x, CYTHON_UNUSED int *__pyx_v_xs) {
8022 :
8023 : /* "scipy/linalg/_decomp_update.pyx":283
8024 : * cdef void blas_t_conj(int n, blas_t* x, int* xs) noexcept nogil:
8025 : * cdef int j
8026 : * if blas_t is float_complex or blas_t is double_complex: # <<<<<<<<<<<<<<
8027 : * for j in range(n):
8028 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8029 : */
8030 :
8031 : /* function exit code */
8032 : }
8033 :
8034 : /* "scipy/linalg/_decomp_update.pyx":281
8035 : * #------------------------------------------------------------------------------
8036 : *
8037 : * cdef void blas_t_conj(int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8038 : * cdef int j
8039 : * if blas_t is float_complex or blas_t is double_complex:
8040 : */
8041 :
8042 1554 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(int __pyx_v_n, __pyx_t_float_complex *__pyx_v_x, int *__pyx_v_xs) {
8043 1554 : int __pyx_v_j;
8044 1554 : int __pyx_t_1;
8045 1554 : int __pyx_t_2;
8046 1554 : int __pyx_t_3;
8047 :
8048 : /* "scipy/linalg/_decomp_update.pyx":284
8049 : * cdef int j
8050 : * if blas_t is float_complex or blas_t is double_complex:
8051 : * for j in range(n): # <<<<<<<<<<<<<<
8052 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8053 : *
8054 : */
8055 1554 : __pyx_t_1 = __pyx_v_n;
8056 1554 : __pyx_t_2 = __pyx_t_1;
8057 14322 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8058 12768 : __pyx_v_j = __pyx_t_3;
8059 :
8060 : /* "scipy/linalg/_decomp_update.pyx":285
8061 : * if blas_t is float_complex or blas_t is double_complex:
8062 : * for j in range(n):
8063 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate() # <<<<<<<<<<<<<<
8064 : *
8065 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil:
8066 : */
8067 12768 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_x, __pyx_v_xs, __pyx_v_j)[0]) = __Pyx_c_conj_float((__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_x, __pyx_v_xs, __pyx_v_j)[0]));
8068 : }
8069 :
8070 : /* "scipy/linalg/_decomp_update.pyx":281
8071 : * #------------------------------------------------------------------------------
8072 : *
8073 : * cdef void blas_t_conj(int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8074 : * cdef int j
8075 : * if blas_t is float_complex or blas_t is double_complex:
8076 : */
8077 :
8078 : /* function exit code */
8079 1554 : }
8080 :
8081 1554 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(int __pyx_v_n, __pyx_t_double_complex *__pyx_v_x, int *__pyx_v_xs) {
8082 1554 : int __pyx_v_j;
8083 1554 : int __pyx_t_1;
8084 1554 : int __pyx_t_2;
8085 1554 : int __pyx_t_3;
8086 :
8087 : /* "scipy/linalg/_decomp_update.pyx":284
8088 : * cdef int j
8089 : * if blas_t is float_complex or blas_t is double_complex:
8090 : * for j in range(n): # <<<<<<<<<<<<<<
8091 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8092 : *
8093 : */
8094 1554 : __pyx_t_1 = __pyx_v_n;
8095 1554 : __pyx_t_2 = __pyx_t_1;
8096 14322 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8097 12768 : __pyx_v_j = __pyx_t_3;
8098 :
8099 : /* "scipy/linalg/_decomp_update.pyx":285
8100 : * if blas_t is float_complex or blas_t is double_complex:
8101 : * for j in range(n):
8102 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate() # <<<<<<<<<<<<<<
8103 : *
8104 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil:
8105 : */
8106 12768 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_x, __pyx_v_xs, __pyx_v_j)[0]) = __Pyx_c_conj_double((__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_x, __pyx_v_xs, __pyx_v_j)[0]));
8107 : }
8108 :
8109 : /* "scipy/linalg/_decomp_update.pyx":281
8110 : * #------------------------------------------------------------------------------
8111 : *
8112 : * cdef void blas_t_conj(int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8113 : * cdef int j
8114 : * if blas_t is float_complex or blas_t is double_complex:
8115 : */
8116 :
8117 : /* function exit code */
8118 1554 : }
8119 :
8120 : /* "scipy/linalg/_decomp_update.pyx":287
8121 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8122 : *
8123 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8124 : * cdef int i, j
8125 : * if blas_t is float_complex or blas_t is double_complex:
8126 : */
8127 :
8128 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(CYTHON_UNUSED int __pyx_v_m, CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED float *__pyx_v_x, CYTHON_UNUSED int *__pyx_v_xs) {
8129 :
8130 : /* "scipy/linalg/_decomp_update.pyx":289
8131 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil:
8132 : * cdef int i, j
8133 : * if blas_t is float_complex or blas_t is double_complex: # <<<<<<<<<<<<<<
8134 : * for i in range(m):
8135 : * for j in range(n):
8136 : */
8137 :
8138 : /* function exit code */
8139 : }
8140 :
8141 : /* "scipy/linalg/_decomp_update.pyx":287
8142 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8143 : *
8144 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8145 : * cdef int i, j
8146 : * if blas_t is float_complex or blas_t is double_complex:
8147 : */
8148 :
8149 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(CYTHON_UNUSED int __pyx_v_m, CYTHON_UNUSED int __pyx_v_n, CYTHON_UNUSED double *__pyx_v_x, CYTHON_UNUSED int *__pyx_v_xs) {
8150 :
8151 : /* "scipy/linalg/_decomp_update.pyx":289
8152 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil:
8153 : * cdef int i, j
8154 : * if blas_t is float_complex or blas_t is double_complex: # <<<<<<<<<<<<<<
8155 : * for i in range(m):
8156 : * for j in range(n):
8157 : */
8158 :
8159 : /* function exit code */
8160 : }
8161 :
8162 : /* "scipy/linalg/_decomp_update.pyx":287
8163 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8164 : *
8165 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8166 : * cdef int i, j
8167 : * if blas_t is float_complex or blas_t is double_complex:
8168 : */
8169 :
8170 223 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_x, int *__pyx_v_xs) {
8171 223 : int __pyx_v_i;
8172 223 : int __pyx_v_j;
8173 223 : int __pyx_t_1;
8174 223 : int __pyx_t_2;
8175 223 : int __pyx_t_3;
8176 223 : int __pyx_t_4;
8177 223 : int __pyx_t_5;
8178 223 : int __pyx_t_6;
8179 :
8180 : /* "scipy/linalg/_decomp_update.pyx":290
8181 : * cdef int i, j
8182 : * if blas_t is float_complex or blas_t is double_complex:
8183 : * for i in range(m): # <<<<<<<<<<<<<<
8184 : * for j in range(n):
8185 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8186 : */
8187 223 : __pyx_t_1 = __pyx_v_m;
8188 223 : __pyx_t_2 = __pyx_t_1;
8189 955 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8190 : __pyx_v_i = __pyx_t_3;
8191 :
8192 : /* "scipy/linalg/_decomp_update.pyx":291
8193 : * if blas_t is float_complex or blas_t is double_complex:
8194 : * for i in range(m):
8195 : * for j in range(n): # <<<<<<<<<<<<<<
8196 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8197 : *
8198 : */
8199 : __pyx_t_4 = __pyx_v_n;
8200 : __pyx_t_5 = __pyx_t_4;
8201 6882 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
8202 6150 : __pyx_v_j = __pyx_t_6;
8203 :
8204 : /* "scipy/linalg/_decomp_update.pyx":292
8205 : * for i in range(m):
8206 : * for j in range(n):
8207 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate() # <<<<<<<<<<<<<<
8208 : *
8209 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil:
8210 : */
8211 6150 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_x, __pyx_v_xs, __pyx_v_i, __pyx_v_j)[0]) = __Pyx_c_conj_float((__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_x, __pyx_v_xs, __pyx_v_i, __pyx_v_j)[0]));
8212 : }
8213 : }
8214 :
8215 : /* "scipy/linalg/_decomp_update.pyx":287
8216 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8217 : *
8218 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8219 : * cdef int i, j
8220 : * if blas_t is float_complex or blas_t is double_complex:
8221 : */
8222 :
8223 : /* function exit code */
8224 223 : }
8225 :
8226 223 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_x, int *__pyx_v_xs) {
8227 223 : int __pyx_v_i;
8228 223 : int __pyx_v_j;
8229 223 : int __pyx_t_1;
8230 223 : int __pyx_t_2;
8231 223 : int __pyx_t_3;
8232 223 : int __pyx_t_4;
8233 223 : int __pyx_t_5;
8234 223 : int __pyx_t_6;
8235 :
8236 : /* "scipy/linalg/_decomp_update.pyx":290
8237 : * cdef int i, j
8238 : * if blas_t is float_complex or blas_t is double_complex:
8239 : * for i in range(m): # <<<<<<<<<<<<<<
8240 : * for j in range(n):
8241 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8242 : */
8243 223 : __pyx_t_1 = __pyx_v_m;
8244 223 : __pyx_t_2 = __pyx_t_1;
8245 955 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8246 : __pyx_v_i = __pyx_t_3;
8247 :
8248 : /* "scipy/linalg/_decomp_update.pyx":291
8249 : * if blas_t is float_complex or blas_t is double_complex:
8250 : * for i in range(m):
8251 : * for j in range(n): # <<<<<<<<<<<<<<
8252 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8253 : *
8254 : */
8255 : __pyx_t_4 = __pyx_v_n;
8256 : __pyx_t_5 = __pyx_t_4;
8257 6882 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
8258 6150 : __pyx_v_j = __pyx_t_6;
8259 :
8260 : /* "scipy/linalg/_decomp_update.pyx":292
8261 : * for i in range(m):
8262 : * for j in range(n):
8263 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate() # <<<<<<<<<<<<<<
8264 : *
8265 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil:
8266 : */
8267 6150 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_x, __pyx_v_xs, __pyx_v_i, __pyx_v_j)[0]) = __Pyx_c_conj_double((__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_x, __pyx_v_xs, __pyx_v_i, __pyx_v_j)[0]));
8268 : }
8269 : }
8270 :
8271 : /* "scipy/linalg/_decomp_update.pyx":287
8272 : * index1(x, xs, j)[0] = index1(x, xs, j)[0].conjugate()
8273 : *
8274 : * cdef void blas_t_2d_conj(int m, int n, blas_t* x, int* xs) noexcept nogil: # <<<<<<<<<<<<<<
8275 : * cdef int i, j
8276 : * if blas_t is float_complex or blas_t is double_complex:
8277 : */
8278 :
8279 : /* function exit code */
8280 223 : }
8281 :
8282 : /* "scipy/linalg/_decomp_update.pyx":294
8283 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8284 : *
8285 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil: # <<<<<<<<<<<<<<
8286 : * if blas_t is float:
8287 : * return sqrt(x)
8288 : */
8289 :
8290 299 : static float __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(float __pyx_v_x) {
8291 299 : float __pyx_r;
8292 :
8293 : /* "scipy/linalg/_decomp_update.pyx":296
8294 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil:
8295 : * if blas_t is float:
8296 : * return sqrt(x) # <<<<<<<<<<<<<<
8297 : * elif blas_t is double:
8298 : * return sqrt(x)
8299 : */
8300 299 : __pyx_r = sqrt(__pyx_v_x);
8301 299 : goto __pyx_L0;
8302 :
8303 : /* "scipy/linalg/_decomp_update.pyx":294
8304 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8305 : *
8306 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil: # <<<<<<<<<<<<<<
8307 : * if blas_t is float:
8308 : * return sqrt(x)
8309 : */
8310 :
8311 : /* function exit code */
8312 299 : __pyx_L0:;
8313 299 : return __pyx_r;
8314 : }
8315 :
8316 299 : static double __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(double __pyx_v_x) {
8317 299 : double __pyx_r;
8318 :
8319 : /* "scipy/linalg/_decomp_update.pyx":298
8320 : * return sqrt(x)
8321 : * elif blas_t is double:
8322 : * return sqrt(x) # <<<<<<<<<<<<<<
8323 : * elif blas_t is float_complex:
8324 : * return <float_complex>sqrt(<double>((<float*>&x)[0]))
8325 : */
8326 299 : __pyx_r = sqrt(__pyx_v_x);
8327 299 : goto __pyx_L0;
8328 :
8329 : /* "scipy/linalg/_decomp_update.pyx":294
8330 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8331 : *
8332 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil: # <<<<<<<<<<<<<<
8333 : * if blas_t is float:
8334 : * return sqrt(x)
8335 : */
8336 :
8337 : /* function exit code */
8338 299 : __pyx_L0:;
8339 299 : return __pyx_r;
8340 : }
8341 :
8342 299 : static __pyx_t_float_complex __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(__pyx_t_float_complex __pyx_v_x) {
8343 299 : __pyx_t_float_complex __pyx_r;
8344 :
8345 : /* "scipy/linalg/_decomp_update.pyx":300
8346 : * return sqrt(x)
8347 : * elif blas_t is float_complex:
8348 : * return <float_complex>sqrt(<double>((<float*>&x)[0])) # <<<<<<<<<<<<<<
8349 : * else:
8350 : * return sqrt((<double*>&x)[0])
8351 : */
8352 299 : __pyx_r = __pyx_t_float_complex_from_parts(((float)sqrt(((double)(((float *)(&__pyx_v_x))[0])))), 0);
8353 299 : goto __pyx_L0;
8354 :
8355 : /* "scipy/linalg/_decomp_update.pyx":294
8356 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8357 : *
8358 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil: # <<<<<<<<<<<<<<
8359 : * if blas_t is float:
8360 : * return sqrt(x)
8361 : */
8362 :
8363 : /* function exit code */
8364 299 : __pyx_L0:;
8365 299 : return __pyx_r;
8366 : }
8367 :
8368 299 : static __pyx_t_double_complex __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(__pyx_t_double_complex __pyx_v_x) {
8369 299 : __pyx_t_double_complex __pyx_r;
8370 :
8371 : /* "scipy/linalg/_decomp_update.pyx":302
8372 : * return <float_complex>sqrt(<double>((<float*>&x)[0]))
8373 : * else:
8374 : * return sqrt((<double*>&x)[0]) # <<<<<<<<<<<<<<
8375 : *
8376 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil:
8377 : */
8378 299 : __pyx_r = __pyx_t_double_complex_from_parts(sqrt((((double *)(&__pyx_v_x))[0])), 0);
8379 299 : goto __pyx_L0;
8380 :
8381 : /* "scipy/linalg/_decomp_update.pyx":294
8382 : * index2(x, xs, i, j)[0] = index2(x, xs, i, j)[0].conjugate()
8383 : *
8384 : * cdef blas_t blas_t_sqrt(blas_t x) noexcept nogil: # <<<<<<<<<<<<<<
8385 : * if blas_t is float:
8386 : * return sqrt(x)
8387 : */
8388 :
8389 : /* function exit code */
8390 299 : __pyx_L0:;
8391 299 : return __pyx_r;
8392 : }
8393 :
8394 : /* "scipy/linalg/_decomp_update.pyx":304
8395 : * return sqrt((<double*>&x)[0])
8396 : *
8397 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8398 : * if blas_t is float or blas_t is double:
8399 : * return x < y
8400 : */
8401 :
8402 775 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(float __pyx_v_x, float __pyx_v_y) {
8403 775 : int __pyx_r;
8404 :
8405 : /* "scipy/linalg/_decomp_update.pyx":306
8406 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil:
8407 : * if blas_t is float or blas_t is double:
8408 : * return x < y # <<<<<<<<<<<<<<
8409 : * else:
8410 : * return x.real < y.real
8411 : */
8412 775 : __pyx_r = (__pyx_v_x < __pyx_v_y);
8413 775 : goto __pyx_L0;
8414 :
8415 : /* "scipy/linalg/_decomp_update.pyx":304
8416 : * return sqrt((<double*>&x)[0])
8417 : *
8418 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8419 : * if blas_t is float or blas_t is double:
8420 : * return x < y
8421 : */
8422 :
8423 : /* function exit code */
8424 775 : __pyx_L0:;
8425 775 : return __pyx_r;
8426 : }
8427 :
8428 775 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(double __pyx_v_x, double __pyx_v_y) {
8429 775 : int __pyx_r;
8430 :
8431 : /* "scipy/linalg/_decomp_update.pyx":306
8432 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil:
8433 : * if blas_t is float or blas_t is double:
8434 : * return x < y # <<<<<<<<<<<<<<
8435 : * else:
8436 : * return x.real < y.real
8437 : */
8438 775 : __pyx_r = (__pyx_v_x < __pyx_v_y);
8439 775 : goto __pyx_L0;
8440 :
8441 : /* "scipy/linalg/_decomp_update.pyx":304
8442 : * return sqrt((<double*>&x)[0])
8443 : *
8444 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8445 : * if blas_t is float or blas_t is double:
8446 : * return x < y
8447 : */
8448 :
8449 : /* function exit code */
8450 775 : __pyx_L0:;
8451 775 : return __pyx_r;
8452 : }
8453 :
8454 785 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_t_float_complex __pyx_v_x, __pyx_t_float_complex __pyx_v_y) {
8455 785 : int __pyx_r;
8456 :
8457 : /* "scipy/linalg/_decomp_update.pyx":308
8458 : * return x < y
8459 : * else:
8460 : * return x.real < y.real # <<<<<<<<<<<<<<
8461 : *
8462 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil:
8463 : */
8464 785 : __pyx_r = (__Pyx_CREAL(__pyx_v_x) < __Pyx_CREAL(__pyx_v_y));
8465 785 : goto __pyx_L0;
8466 :
8467 : /* "scipy/linalg/_decomp_update.pyx":304
8468 : * return sqrt((<double*>&x)[0])
8469 : *
8470 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8471 : * if blas_t is float or blas_t is double:
8472 : * return x < y
8473 : */
8474 :
8475 : /* function exit code */
8476 785 : __pyx_L0:;
8477 785 : return __pyx_r;
8478 : }
8479 :
8480 785 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_t_double_complex __pyx_v_x, __pyx_t_double_complex __pyx_v_y) {
8481 785 : int __pyx_r;
8482 :
8483 : /* "scipy/linalg/_decomp_update.pyx":308
8484 : * return x < y
8485 : * else:
8486 : * return x.real < y.real # <<<<<<<<<<<<<<
8487 : *
8488 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil:
8489 : */
8490 785 : __pyx_r = (__Pyx_CREAL(__pyx_v_x) < __Pyx_CREAL(__pyx_v_y));
8491 785 : goto __pyx_L0;
8492 :
8493 : /* "scipy/linalg/_decomp_update.pyx":304
8494 : * return sqrt((<double*>&x)[0])
8495 : *
8496 : * cdef bint blas_t_less_than(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8497 : * if blas_t is float or blas_t is double:
8498 : * return x < y
8499 : */
8500 :
8501 : /* function exit code */
8502 785 : __pyx_L0:;
8503 785 : return __pyx_r;
8504 : }
8505 :
8506 : /* "scipy/linalg/_decomp_update.pyx":310
8507 : * return x.real < y.real
8508 : *
8509 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8510 : * if blas_t is float or blas_t is double:
8511 : * return x <= y
8512 : */
8513 :
8514 298 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(float __pyx_v_x, float __pyx_v_y) {
8515 298 : int __pyx_r;
8516 :
8517 : /* "scipy/linalg/_decomp_update.pyx":312
8518 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil:
8519 : * if blas_t is float or blas_t is double:
8520 : * return x <= y # <<<<<<<<<<<<<<
8521 : * else:
8522 : * return x.real <= y.real
8523 : */
8524 298 : __pyx_r = (__pyx_v_x <= __pyx_v_y);
8525 298 : goto __pyx_L0;
8526 :
8527 : /* "scipy/linalg/_decomp_update.pyx":310
8528 : * return x.real < y.real
8529 : *
8530 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8531 : * if blas_t is float or blas_t is double:
8532 : * return x <= y
8533 : */
8534 :
8535 : /* function exit code */
8536 298 : __pyx_L0:;
8537 298 : return __pyx_r;
8538 : }
8539 :
8540 298 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(double __pyx_v_x, double __pyx_v_y) {
8541 298 : int __pyx_r;
8542 :
8543 : /* "scipy/linalg/_decomp_update.pyx":312
8544 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil:
8545 : * if blas_t is float or blas_t is double:
8546 : * return x <= y # <<<<<<<<<<<<<<
8547 : * else:
8548 : * return x.real <= y.real
8549 : */
8550 298 : __pyx_r = (__pyx_v_x <= __pyx_v_y);
8551 298 : goto __pyx_L0;
8552 :
8553 : /* "scipy/linalg/_decomp_update.pyx":310
8554 : * return x.real < y.real
8555 : *
8556 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8557 : * if blas_t is float or blas_t is double:
8558 : * return x <= y
8559 : */
8560 :
8561 : /* function exit code */
8562 298 : __pyx_L0:;
8563 298 : return __pyx_r;
8564 : }
8565 :
8566 298 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_t_float_complex __pyx_v_x, __pyx_t_float_complex __pyx_v_y) {
8567 298 : int __pyx_r;
8568 :
8569 : /* "scipy/linalg/_decomp_update.pyx":314
8570 : * return x <= y
8571 : * else:
8572 : * return x.real <= y.real # <<<<<<<<<<<<<<
8573 : *
8574 : * cdef int to_lwork(blas_t a, blas_t b) noexcept nogil:
8575 : */
8576 298 : __pyx_r = (__Pyx_CREAL(__pyx_v_x) <= __Pyx_CREAL(__pyx_v_y));
8577 298 : goto __pyx_L0;
8578 :
8579 : /* "scipy/linalg/_decomp_update.pyx":310
8580 : * return x.real < y.real
8581 : *
8582 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8583 : * if blas_t is float or blas_t is double:
8584 : * return x <= y
8585 : */
8586 :
8587 : /* function exit code */
8588 298 : __pyx_L0:;
8589 298 : return __pyx_r;
8590 : }
8591 :
8592 298 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_t_double_complex __pyx_v_x, __pyx_t_double_complex __pyx_v_y) {
8593 298 : int __pyx_r;
8594 :
8595 : /* "scipy/linalg/_decomp_update.pyx":314
8596 : * return x <= y
8597 : * else:
8598 : * return x.real <= y.real # <<<<<<<<<<<<<<
8599 : *
8600 : * cdef int to_lwork(blas_t a, blas_t b) noexcept nogil:
8601 : */
8602 298 : __pyx_r = (__Pyx_CREAL(__pyx_v_x) <= __Pyx_CREAL(__pyx_v_y));
8603 298 : goto __pyx_L0;
8604 :
8605 : /* "scipy/linalg/_decomp_update.pyx":310
8606 : * return x.real < y.real
8607 : *
8608 : * cdef bint blas_t_less_equal(blas_t x, blas_t y) noexcept nogil: # <<<<<<<<<<<<<<
8609 : * if blas_t is float or blas_t is double:
8610 : * return x <= y
8611 : */
8612 :
8613 : /* function exit code */
8614 298 : __pyx_L0:;
8615 298 : return __pyx_r;
8616 : }
8617 :
8618 : /* "scipy/linalg/_decomp_update.pyx":316
8619 : * return x.real <= y.real
8620 : *
8621 : * cdef int to_lwork(blas_t a, blas_t b) noexcept nogil: # <<<<<<<<<<<<<<
8622 : * cdef int ai, bi
8623 : * if blas_t is float or blas_t is double:
8624 : */
8625 :
8626 93 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(float __pyx_v_a, float __pyx_v_b) {
8627 93 : int __pyx_v_ai;
8628 93 : int __pyx_v_bi;
8629 93 : int __pyx_r;
8630 93 : int __pyx_t_1;
8631 93 : int __pyx_t_2;
8632 93 : int __pyx_t_3;
8633 93 : int __pyx_t_4;
8634 :
8635 : /* "scipy/linalg/_decomp_update.pyx":319
8636 : * cdef int ai, bi
8637 : * if blas_t is float or blas_t is double:
8638 : * ai = <int>a # <<<<<<<<<<<<<<
8639 : * bi = <int>b
8640 : * elif blas_t is float_complex:
8641 : */
8642 93 : __pyx_v_ai = ((int)__pyx_v_a);
8643 :
8644 : /* "scipy/linalg/_decomp_update.pyx":320
8645 : * if blas_t is float or blas_t is double:
8646 : * ai = <int>a
8647 : * bi = <int>b # <<<<<<<<<<<<<<
8648 : * elif blas_t is float_complex:
8649 : * ai = <int>((<float*>&a)[0])
8650 : */
8651 93 : __pyx_v_bi = ((int)__pyx_v_b);
8652 :
8653 : /* "scipy/linalg/_decomp_update.pyx":327
8654 : * ai = <int>((<double*>&a)[0])
8655 : * bi = <int>((<double*>&b)[0])
8656 : * return max(ai, bi) # <<<<<<<<<<<<<<
8657 : *
8658 : * #------------------------------------------------------------------------------
8659 : */
8660 93 : __pyx_t_1 = __pyx_v_bi;
8661 93 : __pyx_t_2 = __pyx_v_ai;
8662 93 : __pyx_t_4 = (__pyx_t_1 > __pyx_t_2);
8663 93 : if (__pyx_t_4) {
8664 : __pyx_t_3 = __pyx_t_1;
8665 : } else {
8666 : __pyx_t_3 = __pyx_t_2;
8667 : }
8668 93 : __pyx_r = __pyx_t_3;
8669 93 : goto __pyx_L0;
8670 :
8671 : /* "scipy/linalg/_decomp_update.pyx":316
8672 : * return x.real <= y.real
8673 : *
8674 : * cdef int to_lwork(blas_t a, blas_t b) noexcept nogil: # <<<<<<<<<<<<<<
8675 : * cdef int ai, bi
8676 : * if blas_t is float or blas_t is double:
8677 : */
8678 :
8679 : /* function exit code */
8680 93 : __pyx_L0:;
8681 93 : return __pyx_r;
8682 : }
8683 :
8684 93 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(double __pyx_v_a, double __pyx_v_b) {
8685 93 : int __pyx_v_ai;
8686 93 : int __pyx_v_bi;
8687 93 : int __pyx_r;
8688 93 : int __pyx_t_1;
8689 93 : int __pyx_t_2;
8690 93 : int __pyx_t_3;
8691 93 : int __pyx_t_4;
8692 :
8693 : /* "scipy/linalg/_decomp_update.pyx":319
8694 : * cdef int ai, bi
8695 : * if blas_t is float or blas_t is double:
8696 : * ai = <int>a # <<<<<<<<<<<<<<
8697 : * bi = <int>b
8698 : * elif blas_t is float_complex:
8699 : */
8700 93 : __pyx_v_ai = ((int)__pyx_v_a);
8701 :
8702 : /* "scipy/linalg/_decomp_update.pyx":320
8703 : * if blas_t is float or blas_t is double:
8704 : * ai = <int>a
8705 : * bi = <int>b # <<<<<<<<<<<<<<
8706 : * elif blas_t is float_complex:
8707 : * ai = <int>((<float*>&a)[0])
8708 : */
8709 93 : __pyx_v_bi = ((int)__pyx_v_b);
8710 :
8711 : /* "scipy/linalg/_decomp_update.pyx":327
8712 : * ai = <int>((<double*>&a)[0])
8713 : * bi = <int>((<double*>&b)[0])
8714 : * return max(ai, bi) # <<<<<<<<<<<<<<
8715 : *
8716 : * #------------------------------------------------------------------------------
8717 : */
8718 93 : __pyx_t_1 = __pyx_v_bi;
8719 93 : __pyx_t_2 = __pyx_v_ai;
8720 93 : __pyx_t_4 = (__pyx_t_1 > __pyx_t_2);
8721 93 : if (__pyx_t_4) {
8722 : __pyx_t_3 = __pyx_t_1;
8723 : } else {
8724 : __pyx_t_3 = __pyx_t_2;
8725 : }
8726 93 : __pyx_r = __pyx_t_3;
8727 93 : goto __pyx_L0;
8728 :
8729 : /* "scipy/linalg/_decomp_update.pyx":316
8730 : * return x.real <= y.real
8731 : *
8732 : * cdef int to_lwork(blas_t a, blas_t b) noexcept nogil: # <<<<<<<<<<<<<<
8733 : * cdef int ai, bi
8734 : * if blas_t is float or blas_t is double:
8735 : */
8736 :
8737 : /* function exit code */
8738 93 : __pyx_L0:;
8739 93 : return __pyx_r;
8740 : }
8741 :
8742 93 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_t_float_complex __pyx_v_a, __pyx_t_float_complex __pyx_v_b) {
8743 93 : int __pyx_v_ai;
8744 93 : int __pyx_v_bi;
8745 93 : int __pyx_r;
8746 93 : int __pyx_t_1;
8747 93 : int __pyx_t_2;
8748 93 : int __pyx_t_3;
8749 93 : int __pyx_t_4;
8750 :
8751 : /* "scipy/linalg/_decomp_update.pyx":322
8752 : * bi = <int>b
8753 : * elif blas_t is float_complex:
8754 : * ai = <int>((<float*>&a)[0]) # <<<<<<<<<<<<<<
8755 : * bi = <int>((<float*>&b)[0])
8756 : * elif blas_t is double_complex:
8757 : */
8758 93 : __pyx_v_ai = ((int)(((float *)(&__pyx_v_a))[0]));
8759 :
8760 : /* "scipy/linalg/_decomp_update.pyx":323
8761 : * elif blas_t is float_complex:
8762 : * ai = <int>((<float*>&a)[0])
8763 : * bi = <int>((<float*>&b)[0]) # <<<<<<<<<<<<<<
8764 : * elif blas_t is double_complex:
8765 : * ai = <int>((<double*>&a)[0])
8766 : */
8767 93 : __pyx_v_bi = ((int)(((float *)(&__pyx_v_b))[0]));
8768 :
8769 : /* "scipy/linalg/_decomp_update.pyx":327
8770 : * ai = <int>((<double*>&a)[0])
8771 : * bi = <int>((<double*>&b)[0])
8772 : * return max(ai, bi) # <<<<<<<<<<<<<<
8773 : *
8774 : * #------------------------------------------------------------------------------
8775 : */
8776 93 : __pyx_t_1 = __pyx_v_bi;
8777 93 : __pyx_t_2 = __pyx_v_ai;
8778 93 : __pyx_t_4 = (__pyx_t_1 > __pyx_t_2);
8779 93 : if (__pyx_t_4) {
8780 : __pyx_t_3 = __pyx_t_1;
8781 : } else {
8782 : __pyx_t_3 = __pyx_t_2;
8783 : }
8784 93 : __pyx_r = __pyx_t_3;
8785 93 : goto __pyx_L0;
8786 :
8787 : /* "scipy/linalg/_decomp_update.pyx":316
8788 : * return x.real <= y.real
8789 : *
8790 : * cdef int to_lwork(blas_t a, blas_t b) noexcept nogil: # <<<<<<<<<<<<<<
8791 : * cdef int ai, bi
8792 : * if blas_t is float or blas_t is double:
8793 : */
8794 :
8795 : /* function exit code */
8796 93 : __pyx_L0:;
8797 93 : return __pyx_r;
8798 : }
8799 :
8800 93 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_t_double_complex __pyx_v_a, __pyx_t_double_complex __pyx_v_b) {
8801 93 : int __pyx_v_ai;
8802 93 : int __pyx_v_bi;
8803 93 : int __pyx_r;
8804 93 : int __pyx_t_1;
8805 93 : int __pyx_t_2;
8806 93 : int __pyx_t_3;
8807 93 : int __pyx_t_4;
8808 :
8809 : /* "scipy/linalg/_decomp_update.pyx":325
8810 : * bi = <int>((<float*>&b)[0])
8811 : * elif blas_t is double_complex:
8812 : * ai = <int>((<double*>&a)[0]) # <<<<<<<<<<<<<<
8813 : * bi = <int>((<double*>&b)[0])
8814 : * return max(ai, bi)
8815 : */
8816 93 : __pyx_v_ai = ((int)(((double *)(&__pyx_v_a))[0]));
8817 :
8818 : /* "scipy/linalg/_decomp_update.pyx":326
8819 : * elif blas_t is double_complex:
8820 : * ai = <int>((<double*>&a)[0])
8821 : * bi = <int>((<double*>&b)[0]) # <<<<<<<<<<<<<<
8822 : * return max(ai, bi)
8823 : *
8824 : */
8825 93 : __pyx_v_bi = ((int)(((double *)(&__pyx_v_b))[0]));
8826 :
8827 : /* "scipy/linalg/_decomp_update.pyx":327
8828 : * ai = <int>((<double*>&a)[0])
8829 : * bi = <int>((<double*>&b)[0])
8830 : * return max(ai, bi) # <<<<<<<<<<<<<<
8831 : *
8832 : * #------------------------------------------------------------------------------
8833 : */
8834 93 : __pyx_t_1 = __pyx_v_bi;
8835 93 : __pyx_t_2 = __pyx_v_ai;
8836 93 : __pyx_t_4 = (__pyx_t_1 > __pyx_t_2);
8837 93 : if (__pyx_t_4) {
8838 : __pyx_t_3 = __pyx_t_1;
8839 : } else {
8840 : __pyx_t_3 = __pyx_t_2;
8841 : }
8842 93 : __pyx_r = __pyx_t_3;
8843 93 : goto __pyx_L0;
8844 :
8845 : /* "scipy/linalg/_decomp_update.pyx":316
8846 : * return x.real <= y.real
8847 : *
8848 : * cdef int to_lwork(blas_t a, blas_t b) noexcept nogil: # <<<<<<<<<<<<<<
8849 : * cdef int ai, bi
8850 : * if blas_t is float or blas_t is double:
8851 : */
8852 :
8853 : /* function exit code */
8854 93 : __pyx_L0:;
8855 93 : return __pyx_r;
8856 : }
8857 :
8858 : /* "scipy/linalg/_decomp_update.pyx":333
8859 : * #------------------------------------------------------------------------------
8860 : *
8861 : * cdef bint reorthx(int m, int n, blas_t* q, int* qs, bint qisF, int j, blas_t* u, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
8862 : * # U should be all zeros on entry., and m > 1
8863 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
8864 : */
8865 :
8866 99 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, int __pyx_v_j, float *__pyx_v_u, float *__pyx_v_s) {
8867 99 : float __pyx_v_wnorm;
8868 99 : float __pyx_v_wpnorm;
8869 99 : char *__pyx_v_T;
8870 99 : char *__pyx_v_N;
8871 99 : CYTHON_UNUSED char *__pyx_v_C;
8872 99 : int __pyx_v_ss;
8873 99 : float __pyx_v_inv_root2;
8874 99 : int __pyx_r;
8875 99 : int __pyx_t_1;
8876 99 : int __pyx_lineno = 0;
8877 99 : const char *__pyx_filename = NULL;
8878 99 : int __pyx_clineno = 0;
8879 : #ifdef WITH_THREAD
8880 99 : PyGILState_STATE __pyx_gilstate_save;
8881 : #endif
8882 :
8883 : /* "scipy/linalg/_decomp_update.pyx":336
8884 : * # U should be all zeros on entry., and m > 1
8885 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
8886 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
8887 : * cdef char* N = 'N'
8888 : * cdef char* C = 'C'
8889 : */
8890 99 : __pyx_v_T = ((char *)"T");
8891 :
8892 : /* "scipy/linalg/_decomp_update.pyx":337
8893 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
8894 : * cdef char* T = 'T'
8895 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
8896 : * cdef char* C = 'C'
8897 : * cdef int ss = 1
8898 : */
8899 99 : __pyx_v_N = ((char *)"N");
8900 :
8901 : /* "scipy/linalg/_decomp_update.pyx":338
8902 : * cdef char* T = 'T'
8903 : * cdef char* N = 'N'
8904 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
8905 : * cdef int ss = 1
8906 : * cdef blas_t inv_root2 = M_SQRT1_2
8907 : */
8908 99 : __pyx_v_C = ((char *)"C");
8909 :
8910 : /* "scipy/linalg/_decomp_update.pyx":339
8911 : * cdef char* N = 'N'
8912 : * cdef char* C = 'C'
8913 : * cdef int ss = 1 # <<<<<<<<<<<<<<
8914 : * cdef blas_t inv_root2 = M_SQRT1_2
8915 : *
8916 : */
8917 99 : __pyx_v_ss = 1;
8918 :
8919 : /* "scipy/linalg/_decomp_update.pyx":340
8920 : * cdef char* C = 'C'
8921 : * cdef int ss = 1
8922 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
8923 : *
8924 : * # u starts out as the jth basis vector.
8925 : */
8926 99 : __pyx_v_inv_root2 = M_SQRT1_2;
8927 :
8928 : /* "scipy/linalg/_decomp_update.pyx":343
8929 : *
8930 : * # u starts out as the jth basis vector.
8931 : * u[j] = 1 # <<<<<<<<<<<<<<
8932 : *
8933 : * # s = Q.T.dot(u) = jth row of Q.
8934 : */
8935 99 : (__pyx_v_u[__pyx_v_j]) = 1.0;
8936 :
8937 : /* "scipy/linalg/_decomp_update.pyx":346
8938 : *
8939 : * # s = Q.T.dot(u) = jth row of Q.
8940 : * copy(n, row(q, qs, j), qs[1], s, 1) # <<<<<<<<<<<<<<
8941 : * blas_t_conj(n, s, &ss)
8942 : *
8943 : */
8944 99 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_n, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_s, 1);
8945 :
8946 : /* "scipy/linalg/_decomp_update.pyx":347
8947 : * # s = Q.T.dot(u) = jth row of Q.
8948 : * copy(n, row(q, qs, j), qs[1], s, 1)
8949 : * blas_t_conj(n, s, &ss) # <<<<<<<<<<<<<<
8950 : *
8951 : * # make u be the part of u that is not in span(q)
8952 : */
8953 99 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_s, (&__pyx_v_ss));
8954 :
8955 : /* "scipy/linalg/_decomp_update.pyx":351
8956 : * # make u be the part of u that is not in span(q)
8957 : * # i.e. u -= q.dot(s)
8958 : * if qisF: # <<<<<<<<<<<<<<
8959 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
8960 : * else:
8961 : */
8962 99 : if (__pyx_v_qisF) {
8963 :
8964 : /* "scipy/linalg/_decomp_update.pyx":352
8965 : * # i.e. u -= q.dot(s)
8966 : * if qisF:
8967 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1) # <<<<<<<<<<<<<<
8968 : * else:
8969 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
8970 : */
8971 99 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_s, 1, 1.0, __pyx_v_u, 1);
8972 :
8973 : /* "scipy/linalg/_decomp_update.pyx":351
8974 : * # make u be the part of u that is not in span(q)
8975 : * # i.e. u -= q.dot(s)
8976 : * if qisF: # <<<<<<<<<<<<<<
8977 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
8978 : * else:
8979 : */
8980 99 : goto __pyx_L3;
8981 : }
8982 :
8983 : /* "scipy/linalg/_decomp_update.pyx":354
8984 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
8985 : * else:
8986 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1) # <<<<<<<<<<<<<<
8987 : * wnorm = nrm2(m, u, 1)
8988 : *
8989 : */
8990 : /*else*/ {
8991 0 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, 1.0, __pyx_v_u, 1);
8992 : }
8993 99 : __pyx_L3:;
8994 :
8995 : /* "scipy/linalg/_decomp_update.pyx":355
8996 : * else:
8997 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
8998 : * wnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
8999 : *
9000 : * if blas_t_less_than(inv_root2, wnorm):
9001 : */
9002 99 : __pyx_v_wnorm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
9003 :
9004 : /* "scipy/linalg/_decomp_update.pyx":357
9005 : * wnorm = nrm2(m, u, 1)
9006 : *
9007 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
9008 : * with cython.cdivision(True):
9009 : * scal(m, 1/wnorm, u, 1)
9010 : */
9011 99 : __pyx_t_1 = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
9012 99 : if (__pyx_t_1) {
9013 :
9014 : /* "scipy/linalg/_decomp_update.pyx":359
9015 : * if blas_t_less_than(inv_root2, wnorm):
9016 : * with cython.cdivision(True):
9017 : * scal(m, 1/wnorm, u, 1) # <<<<<<<<<<<<<<
9018 : * s[n] = wnorm
9019 : * return True
9020 : */
9021 20 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wnorm), __pyx_v_u, 1);
9022 :
9023 : /* "scipy/linalg/_decomp_update.pyx":360
9024 : * with cython.cdivision(True):
9025 : * scal(m, 1/wnorm, u, 1)
9026 : * s[n] = wnorm # <<<<<<<<<<<<<<
9027 : * return True
9028 : *
9029 : */
9030 20 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wnorm;
9031 :
9032 : /* "scipy/linalg/_decomp_update.pyx":361
9033 : * scal(m, 1/wnorm, u, 1)
9034 : * s[n] = wnorm
9035 : * return True # <<<<<<<<<<<<<<
9036 : *
9037 : * # if the above check failed, try one reorthogonalization
9038 : */
9039 20 : __pyx_r = 1;
9040 20 : goto __pyx_L0;
9041 :
9042 : /* "scipy/linalg/_decomp_update.pyx":357
9043 : * wnorm = nrm2(m, u, 1)
9044 : *
9045 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
9046 : * with cython.cdivision(True):
9047 : * scal(m, 1/wnorm, u, 1)
9048 : */
9049 : }
9050 :
9051 : /* "scipy/linalg/_decomp_update.pyx":364
9052 : *
9053 : * # if the above check failed, try one reorthogonalization
9054 : * if qisF: # <<<<<<<<<<<<<<
9055 : * if blas_t is float or blas_t is double:
9056 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9057 : */
9058 79 : if (__pyx_v_qisF) {
9059 :
9060 : /* "scipy/linalg/_decomp_update.pyx":366
9061 : * if qisF:
9062 : * if blas_t is float or blas_t is double:
9063 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
9064 : * else:
9065 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9066 : */
9067 79 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_u, 1, 0.0, (__pyx_v_s + __pyx_v_n), 1);
9068 :
9069 : /* "scipy/linalg/_decomp_update.pyx":369
9070 : * else:
9071 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9072 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
9073 : * else:
9074 : * if blas_t is float or blas_t is double:
9075 : */
9076 79 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, (__pyx_v_qs[1]), (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, 1);
9077 :
9078 : /* "scipy/linalg/_decomp_update.pyx":364
9079 : *
9080 : * # if the above check failed, try one reorthogonalization
9081 : * if qisF: # <<<<<<<<<<<<<<
9082 : * if blas_t is float or blas_t is double:
9083 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9084 : */
9085 79 : goto __pyx_L5;
9086 : }
9087 :
9088 : /* "scipy/linalg/_decomp_update.pyx":371
9089 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1)
9090 : * else:
9091 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
9092 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
9093 : * else:
9094 : */
9095 : /*else*/ {
9096 :
9097 : /* "scipy/linalg/_decomp_update.pyx":372
9098 : * else:
9099 : * if blas_t is float or blas_t is double:
9100 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
9101 : * else:
9102 : * blas_t_conj(m, u, &ss)
9103 : */
9104 0 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_n, __pyx_v_u, 1, 0.0, (__pyx_v_s + __pyx_v_n), 1);
9105 :
9106 : /* "scipy/linalg/_decomp_update.pyx":378
9107 : * blas_t_conj(m, u, &ss)
9108 : * blas_t_conj(n, s+n, &ss)
9109 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
9110 : * wpnorm = nrm2(m, u, 1)
9111 : *
9112 : */
9113 0 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, 1);
9114 : }
9115 79 : __pyx_L5:;
9116 :
9117 : /* "scipy/linalg/_decomp_update.pyx":379
9118 : * blas_t_conj(n, s+n, &ss)
9119 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
9120 : * wpnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
9121 : *
9122 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9123 : */
9124 79 : __pyx_v_wpnorm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
9125 :
9126 : /* "scipy/linalg/_decomp_update.pyx":381
9127 : * wpnorm = nrm2(m, u, 1)
9128 : *
9129 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
9130 : * scal(m, 0, u, 1)
9131 : * axpy(n, 1, s, 1, s+n, 1)
9132 : */
9133 79 : __pyx_t_1 = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_wpnorm, (__pyx_v_wnorm * __pyx_v_inv_root2));
9134 79 : if (__pyx_t_1) {
9135 :
9136 : /* "scipy/linalg/_decomp_update.pyx":382
9137 : *
9138 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9139 : * scal(m, 0, u, 1) # <<<<<<<<<<<<<<
9140 : * axpy(n, 1, s, 1, s+n, 1)
9141 : * s[n] = 0
9142 : */
9143 0 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, 0.0, __pyx_v_u, 1);
9144 :
9145 : /* "scipy/linalg/_decomp_update.pyx":383
9146 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9147 : * scal(m, 0, u, 1)
9148 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
9149 : * s[n] = 0
9150 : * return False
9151 : */
9152 0 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
9153 :
9154 : /* "scipy/linalg/_decomp_update.pyx":384
9155 : * scal(m, 0, u, 1)
9156 : * axpy(n, 1, s, 1, s+n, 1)
9157 : * s[n] = 0 # <<<<<<<<<<<<<<
9158 : * return False
9159 : *
9160 : */
9161 0 : (__pyx_v_s[__pyx_v_n]) = 0.0;
9162 :
9163 : /* "scipy/linalg/_decomp_update.pyx":385
9164 : * axpy(n, 1, s, 1, s+n, 1)
9165 : * s[n] = 0
9166 : * return False # <<<<<<<<<<<<<<
9167 : *
9168 : * scal(m, 1/wpnorm, u, 1)
9169 : */
9170 0 : __pyx_r = 0;
9171 0 : goto __pyx_L0;
9172 :
9173 : /* "scipy/linalg/_decomp_update.pyx":381
9174 : * wpnorm = nrm2(m, u, 1)
9175 : *
9176 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
9177 : * scal(m, 0, u, 1)
9178 : * axpy(n, 1, s, 1, s+n, 1)
9179 : */
9180 : }
9181 :
9182 : /* "scipy/linalg/_decomp_update.pyx":387
9183 : * return False
9184 : *
9185 : * scal(m, 1/wpnorm, u, 1) # <<<<<<<<<<<<<<
9186 : * axpy(n, 1, s, 1, s+n, 1)
9187 : * s[n] = wpnorm
9188 : */
9189 79 : if (unlikely(__pyx_v_wpnorm == 0)) {
9190 : #ifdef WITH_THREAD
9191 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
9192 : #endif
9193 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
9194 : #ifdef WITH_THREAD
9195 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
9196 : #endif
9197 0 : __PYX_ERR(0, 387, __pyx_L1_error)
9198 : }
9199 79 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wpnorm), __pyx_v_u, 1);
9200 :
9201 : /* "scipy/linalg/_decomp_update.pyx":388
9202 : *
9203 : * scal(m, 1/wpnorm, u, 1)
9204 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
9205 : * s[n] = wpnorm
9206 : * return True
9207 : */
9208 79 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
9209 :
9210 : /* "scipy/linalg/_decomp_update.pyx":389
9211 : * scal(m, 1/wpnorm, u, 1)
9212 : * axpy(n, 1, s, 1, s+n, 1)
9213 : * s[n] = wpnorm # <<<<<<<<<<<<<<
9214 : * return True
9215 : *
9216 : */
9217 79 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wpnorm;
9218 :
9219 : /* "scipy/linalg/_decomp_update.pyx":390
9220 : * axpy(n, 1, s, 1, s+n, 1)
9221 : * s[n] = wpnorm
9222 : * return True # <<<<<<<<<<<<<<
9223 : *
9224 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF,
9225 : */
9226 79 : __pyx_r = 1;
9227 79 : goto __pyx_L0;
9228 :
9229 : /* "scipy/linalg/_decomp_update.pyx":333
9230 : * #------------------------------------------------------------------------------
9231 : *
9232 : * cdef bint reorthx(int m, int n, blas_t* q, int* qs, bint qisF, int j, blas_t* u, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
9233 : * # U should be all zeros on entry., and m > 1
9234 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
9235 : */
9236 :
9237 : /* function exit code */
9238 0 : __pyx_L1_error:;
9239 : #ifdef WITH_THREAD
9240 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
9241 : #endif
9242 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorthx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9243 0 : __pyx_r = 0;
9244 : #ifdef WITH_THREAD
9245 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
9246 : #endif
9247 99 : __pyx_L0:;
9248 99 : return __pyx_r;
9249 : }
9250 :
9251 99 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, int __pyx_v_j, double *__pyx_v_u, double *__pyx_v_s) {
9252 99 : double __pyx_v_wnorm;
9253 99 : double __pyx_v_wpnorm;
9254 99 : char *__pyx_v_T;
9255 99 : char *__pyx_v_N;
9256 99 : CYTHON_UNUSED char *__pyx_v_C;
9257 99 : int __pyx_v_ss;
9258 99 : double __pyx_v_inv_root2;
9259 99 : int __pyx_r;
9260 99 : int __pyx_t_1;
9261 99 : int __pyx_lineno = 0;
9262 99 : const char *__pyx_filename = NULL;
9263 99 : int __pyx_clineno = 0;
9264 : #ifdef WITH_THREAD
9265 99 : PyGILState_STATE __pyx_gilstate_save;
9266 : #endif
9267 :
9268 : /* "scipy/linalg/_decomp_update.pyx":336
9269 : * # U should be all zeros on entry., and m > 1
9270 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
9271 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
9272 : * cdef char* N = 'N'
9273 : * cdef char* C = 'C'
9274 : */
9275 99 : __pyx_v_T = ((char *)"T");
9276 :
9277 : /* "scipy/linalg/_decomp_update.pyx":337
9278 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
9279 : * cdef char* T = 'T'
9280 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
9281 : * cdef char* C = 'C'
9282 : * cdef int ss = 1
9283 : */
9284 99 : __pyx_v_N = ((char *)"N");
9285 :
9286 : /* "scipy/linalg/_decomp_update.pyx":338
9287 : * cdef char* T = 'T'
9288 : * cdef char* N = 'N'
9289 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
9290 : * cdef int ss = 1
9291 : * cdef blas_t inv_root2 = M_SQRT1_2
9292 : */
9293 99 : __pyx_v_C = ((char *)"C");
9294 :
9295 : /* "scipy/linalg/_decomp_update.pyx":339
9296 : * cdef char* N = 'N'
9297 : * cdef char* C = 'C'
9298 : * cdef int ss = 1 # <<<<<<<<<<<<<<
9299 : * cdef blas_t inv_root2 = M_SQRT1_2
9300 : *
9301 : */
9302 99 : __pyx_v_ss = 1;
9303 :
9304 : /* "scipy/linalg/_decomp_update.pyx":340
9305 : * cdef char* C = 'C'
9306 : * cdef int ss = 1
9307 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
9308 : *
9309 : * # u starts out as the jth basis vector.
9310 : */
9311 99 : __pyx_v_inv_root2 = M_SQRT1_2;
9312 :
9313 : /* "scipy/linalg/_decomp_update.pyx":343
9314 : *
9315 : * # u starts out as the jth basis vector.
9316 : * u[j] = 1 # <<<<<<<<<<<<<<
9317 : *
9318 : * # s = Q.T.dot(u) = jth row of Q.
9319 : */
9320 99 : (__pyx_v_u[__pyx_v_j]) = 1.0;
9321 :
9322 : /* "scipy/linalg/_decomp_update.pyx":346
9323 : *
9324 : * # s = Q.T.dot(u) = jth row of Q.
9325 : * copy(n, row(q, qs, j), qs[1], s, 1) # <<<<<<<<<<<<<<
9326 : * blas_t_conj(n, s, &ss)
9327 : *
9328 : */
9329 99 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_n, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_s, 1);
9330 :
9331 : /* "scipy/linalg/_decomp_update.pyx":347
9332 : * # s = Q.T.dot(u) = jth row of Q.
9333 : * copy(n, row(q, qs, j), qs[1], s, 1)
9334 : * blas_t_conj(n, s, &ss) # <<<<<<<<<<<<<<
9335 : *
9336 : * # make u be the part of u that is not in span(q)
9337 : */
9338 99 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_s, (&__pyx_v_ss));
9339 :
9340 : /* "scipy/linalg/_decomp_update.pyx":351
9341 : * # make u be the part of u that is not in span(q)
9342 : * # i.e. u -= q.dot(s)
9343 : * if qisF: # <<<<<<<<<<<<<<
9344 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
9345 : * else:
9346 : */
9347 99 : if (__pyx_v_qisF) {
9348 :
9349 : /* "scipy/linalg/_decomp_update.pyx":352
9350 : * # i.e. u -= q.dot(s)
9351 : * if qisF:
9352 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1) # <<<<<<<<<<<<<<
9353 : * else:
9354 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
9355 : */
9356 99 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_s, 1, 1.0, __pyx_v_u, 1);
9357 :
9358 : /* "scipy/linalg/_decomp_update.pyx":351
9359 : * # make u be the part of u that is not in span(q)
9360 : * # i.e. u -= q.dot(s)
9361 : * if qisF: # <<<<<<<<<<<<<<
9362 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
9363 : * else:
9364 : */
9365 99 : goto __pyx_L3;
9366 : }
9367 :
9368 : /* "scipy/linalg/_decomp_update.pyx":354
9369 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
9370 : * else:
9371 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1) # <<<<<<<<<<<<<<
9372 : * wnorm = nrm2(m, u, 1)
9373 : *
9374 : */
9375 : /*else*/ {
9376 0 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, 1.0, __pyx_v_u, 1);
9377 : }
9378 99 : __pyx_L3:;
9379 :
9380 : /* "scipy/linalg/_decomp_update.pyx":355
9381 : * else:
9382 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
9383 : * wnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
9384 : *
9385 : * if blas_t_less_than(inv_root2, wnorm):
9386 : */
9387 99 : __pyx_v_wnorm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
9388 :
9389 : /* "scipy/linalg/_decomp_update.pyx":357
9390 : * wnorm = nrm2(m, u, 1)
9391 : *
9392 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
9393 : * with cython.cdivision(True):
9394 : * scal(m, 1/wnorm, u, 1)
9395 : */
9396 99 : __pyx_t_1 = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
9397 99 : if (__pyx_t_1) {
9398 :
9399 : /* "scipy/linalg/_decomp_update.pyx":359
9400 : * if blas_t_less_than(inv_root2, wnorm):
9401 : * with cython.cdivision(True):
9402 : * scal(m, 1/wnorm, u, 1) # <<<<<<<<<<<<<<
9403 : * s[n] = wnorm
9404 : * return True
9405 : */
9406 20 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wnorm), __pyx_v_u, 1);
9407 :
9408 : /* "scipy/linalg/_decomp_update.pyx":360
9409 : * with cython.cdivision(True):
9410 : * scal(m, 1/wnorm, u, 1)
9411 : * s[n] = wnorm # <<<<<<<<<<<<<<
9412 : * return True
9413 : *
9414 : */
9415 20 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wnorm;
9416 :
9417 : /* "scipy/linalg/_decomp_update.pyx":361
9418 : * scal(m, 1/wnorm, u, 1)
9419 : * s[n] = wnorm
9420 : * return True # <<<<<<<<<<<<<<
9421 : *
9422 : * # if the above check failed, try one reorthogonalization
9423 : */
9424 20 : __pyx_r = 1;
9425 20 : goto __pyx_L0;
9426 :
9427 : /* "scipy/linalg/_decomp_update.pyx":357
9428 : * wnorm = nrm2(m, u, 1)
9429 : *
9430 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
9431 : * with cython.cdivision(True):
9432 : * scal(m, 1/wnorm, u, 1)
9433 : */
9434 : }
9435 :
9436 : /* "scipy/linalg/_decomp_update.pyx":364
9437 : *
9438 : * # if the above check failed, try one reorthogonalization
9439 : * if qisF: # <<<<<<<<<<<<<<
9440 : * if blas_t is float or blas_t is double:
9441 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9442 : */
9443 79 : if (__pyx_v_qisF) {
9444 :
9445 : /* "scipy/linalg/_decomp_update.pyx":366
9446 : * if qisF:
9447 : * if blas_t is float or blas_t is double:
9448 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
9449 : * else:
9450 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9451 : */
9452 79 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_u, 1, 0.0, (__pyx_v_s + __pyx_v_n), 1);
9453 :
9454 : /* "scipy/linalg/_decomp_update.pyx":369
9455 : * else:
9456 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9457 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
9458 : * else:
9459 : * if blas_t is float or blas_t is double:
9460 : */
9461 79 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, (__pyx_v_qs[1]), (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, 1);
9462 :
9463 : /* "scipy/linalg/_decomp_update.pyx":364
9464 : *
9465 : * # if the above check failed, try one reorthogonalization
9466 : * if qisF: # <<<<<<<<<<<<<<
9467 : * if blas_t is float or blas_t is double:
9468 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9469 : */
9470 79 : goto __pyx_L5;
9471 : }
9472 :
9473 : /* "scipy/linalg/_decomp_update.pyx":371
9474 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1)
9475 : * else:
9476 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
9477 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
9478 : * else:
9479 : */
9480 : /*else*/ {
9481 :
9482 : /* "scipy/linalg/_decomp_update.pyx":372
9483 : * else:
9484 : * if blas_t is float or blas_t is double:
9485 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
9486 : * else:
9487 : * blas_t_conj(m, u, &ss)
9488 : */
9489 0 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_n, __pyx_v_u, 1, 0.0, (__pyx_v_s + __pyx_v_n), 1);
9490 :
9491 : /* "scipy/linalg/_decomp_update.pyx":378
9492 : * blas_t_conj(m, u, &ss)
9493 : * blas_t_conj(n, s+n, &ss)
9494 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
9495 : * wpnorm = nrm2(m, u, 1)
9496 : *
9497 : */
9498 0 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, 1);
9499 : }
9500 79 : __pyx_L5:;
9501 :
9502 : /* "scipy/linalg/_decomp_update.pyx":379
9503 : * blas_t_conj(n, s+n, &ss)
9504 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
9505 : * wpnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
9506 : *
9507 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9508 : */
9509 79 : __pyx_v_wpnorm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
9510 :
9511 : /* "scipy/linalg/_decomp_update.pyx":381
9512 : * wpnorm = nrm2(m, u, 1)
9513 : *
9514 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
9515 : * scal(m, 0, u, 1)
9516 : * axpy(n, 1, s, 1, s+n, 1)
9517 : */
9518 79 : __pyx_t_1 = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_wpnorm, (__pyx_v_wnorm * __pyx_v_inv_root2));
9519 79 : if (__pyx_t_1) {
9520 :
9521 : /* "scipy/linalg/_decomp_update.pyx":382
9522 : *
9523 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9524 : * scal(m, 0, u, 1) # <<<<<<<<<<<<<<
9525 : * axpy(n, 1, s, 1, s+n, 1)
9526 : * s[n] = 0
9527 : */
9528 0 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, 0.0, __pyx_v_u, 1);
9529 :
9530 : /* "scipy/linalg/_decomp_update.pyx":383
9531 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9532 : * scal(m, 0, u, 1)
9533 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
9534 : * s[n] = 0
9535 : * return False
9536 : */
9537 0 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
9538 :
9539 : /* "scipy/linalg/_decomp_update.pyx":384
9540 : * scal(m, 0, u, 1)
9541 : * axpy(n, 1, s, 1, s+n, 1)
9542 : * s[n] = 0 # <<<<<<<<<<<<<<
9543 : * return False
9544 : *
9545 : */
9546 0 : (__pyx_v_s[__pyx_v_n]) = 0.0;
9547 :
9548 : /* "scipy/linalg/_decomp_update.pyx":385
9549 : * axpy(n, 1, s, 1, s+n, 1)
9550 : * s[n] = 0
9551 : * return False # <<<<<<<<<<<<<<
9552 : *
9553 : * scal(m, 1/wpnorm, u, 1)
9554 : */
9555 0 : __pyx_r = 0;
9556 0 : goto __pyx_L0;
9557 :
9558 : /* "scipy/linalg/_decomp_update.pyx":381
9559 : * wpnorm = nrm2(m, u, 1)
9560 : *
9561 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
9562 : * scal(m, 0, u, 1)
9563 : * axpy(n, 1, s, 1, s+n, 1)
9564 : */
9565 : }
9566 :
9567 : /* "scipy/linalg/_decomp_update.pyx":387
9568 : * return False
9569 : *
9570 : * scal(m, 1/wpnorm, u, 1) # <<<<<<<<<<<<<<
9571 : * axpy(n, 1, s, 1, s+n, 1)
9572 : * s[n] = wpnorm
9573 : */
9574 79 : if (unlikely(__pyx_v_wpnorm == 0)) {
9575 : #ifdef WITH_THREAD
9576 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
9577 : #endif
9578 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
9579 : #ifdef WITH_THREAD
9580 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
9581 : #endif
9582 0 : __PYX_ERR(0, 387, __pyx_L1_error)
9583 : }
9584 79 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wpnorm), __pyx_v_u, 1);
9585 :
9586 : /* "scipy/linalg/_decomp_update.pyx":388
9587 : *
9588 : * scal(m, 1/wpnorm, u, 1)
9589 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
9590 : * s[n] = wpnorm
9591 : * return True
9592 : */
9593 79 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
9594 :
9595 : /* "scipy/linalg/_decomp_update.pyx":389
9596 : * scal(m, 1/wpnorm, u, 1)
9597 : * axpy(n, 1, s, 1, s+n, 1)
9598 : * s[n] = wpnorm # <<<<<<<<<<<<<<
9599 : * return True
9600 : *
9601 : */
9602 79 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wpnorm;
9603 :
9604 : /* "scipy/linalg/_decomp_update.pyx":390
9605 : * axpy(n, 1, s, 1, s+n, 1)
9606 : * s[n] = wpnorm
9607 : * return True # <<<<<<<<<<<<<<
9608 : *
9609 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF,
9610 : */
9611 79 : __pyx_r = 1;
9612 79 : goto __pyx_L0;
9613 :
9614 : /* "scipy/linalg/_decomp_update.pyx":333
9615 : * #------------------------------------------------------------------------------
9616 : *
9617 : * cdef bint reorthx(int m, int n, blas_t* q, int* qs, bint qisF, int j, blas_t* u, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
9618 : * # U should be all zeros on entry., and m > 1
9619 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
9620 : */
9621 :
9622 : /* function exit code */
9623 0 : __pyx_L1_error:;
9624 : #ifdef WITH_THREAD
9625 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
9626 : #endif
9627 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorthx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9628 0 : __pyx_r = 0;
9629 : #ifdef WITH_THREAD
9630 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
9631 : #endif
9632 99 : __pyx_L0:;
9633 99 : return __pyx_r;
9634 : }
9635 :
9636 99 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, int __pyx_v_j, __pyx_t_float_complex *__pyx_v_u, __pyx_t_float_complex *__pyx_v_s) {
9637 99 : __pyx_t_float_complex __pyx_v_wnorm;
9638 99 : __pyx_t_float_complex __pyx_v_wpnorm;
9639 99 : char *__pyx_v_T;
9640 99 : char *__pyx_v_N;
9641 99 : char *__pyx_v_C;
9642 99 : int __pyx_v_ss;
9643 99 : __pyx_t_float_complex __pyx_v_inv_root2;
9644 99 : int __pyx_r;
9645 99 : int __pyx_t_1;
9646 99 : __pyx_t_double_complex __pyx_t_2;
9647 99 : __pyx_t_double_complex __pyx_t_3;
9648 99 : __pyx_t_double_complex __pyx_t_4;
9649 99 : int __pyx_lineno = 0;
9650 99 : const char *__pyx_filename = NULL;
9651 99 : int __pyx_clineno = 0;
9652 : #ifdef WITH_THREAD
9653 99 : PyGILState_STATE __pyx_gilstate_save;
9654 : #endif
9655 :
9656 : /* "scipy/linalg/_decomp_update.pyx":336
9657 : * # U should be all zeros on entry., and m > 1
9658 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
9659 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
9660 : * cdef char* N = 'N'
9661 : * cdef char* C = 'C'
9662 : */
9663 99 : __pyx_v_T = ((char *)"T");
9664 :
9665 : /* "scipy/linalg/_decomp_update.pyx":337
9666 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
9667 : * cdef char* T = 'T'
9668 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
9669 : * cdef char* C = 'C'
9670 : * cdef int ss = 1
9671 : */
9672 99 : __pyx_v_N = ((char *)"N");
9673 :
9674 : /* "scipy/linalg/_decomp_update.pyx":338
9675 : * cdef char* T = 'T'
9676 : * cdef char* N = 'N'
9677 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
9678 : * cdef int ss = 1
9679 : * cdef blas_t inv_root2 = M_SQRT1_2
9680 : */
9681 99 : __pyx_v_C = ((char *)"C");
9682 :
9683 : /* "scipy/linalg/_decomp_update.pyx":339
9684 : * cdef char* N = 'N'
9685 : * cdef char* C = 'C'
9686 : * cdef int ss = 1 # <<<<<<<<<<<<<<
9687 : * cdef blas_t inv_root2 = M_SQRT1_2
9688 : *
9689 : */
9690 99 : __pyx_v_ss = 1;
9691 :
9692 : /* "scipy/linalg/_decomp_update.pyx":340
9693 : * cdef char* C = 'C'
9694 : * cdef int ss = 1
9695 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
9696 : *
9697 : * # u starts out as the jth basis vector.
9698 : */
9699 99 : __pyx_v_inv_root2 = __pyx_t_float_complex_from_parts(M_SQRT1_2, 0);
9700 :
9701 : /* "scipy/linalg/_decomp_update.pyx":343
9702 : *
9703 : * # u starts out as the jth basis vector.
9704 : * u[j] = 1 # <<<<<<<<<<<<<<
9705 : *
9706 : * # s = Q.T.dot(u) = jth row of Q.
9707 : */
9708 99 : (__pyx_v_u[__pyx_v_j]) = __pyx_t_float_complex_from_parts(1, 0);
9709 :
9710 : /* "scipy/linalg/_decomp_update.pyx":346
9711 : *
9712 : * # s = Q.T.dot(u) = jth row of Q.
9713 : * copy(n, row(q, qs, j), qs[1], s, 1) # <<<<<<<<<<<<<<
9714 : * blas_t_conj(n, s, &ss)
9715 : *
9716 : */
9717 198 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_n, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_s, 1);
9718 :
9719 : /* "scipy/linalg/_decomp_update.pyx":347
9720 : * # s = Q.T.dot(u) = jth row of Q.
9721 : * copy(n, row(q, qs, j), qs[1], s, 1)
9722 : * blas_t_conj(n, s, &ss) # <<<<<<<<<<<<<<
9723 : *
9724 : * # make u be the part of u that is not in span(q)
9725 : */
9726 99 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_s, (&__pyx_v_ss));
9727 :
9728 : /* "scipy/linalg/_decomp_update.pyx":351
9729 : * # make u be the part of u that is not in span(q)
9730 : * # i.e. u -= q.dot(s)
9731 : * if qisF: # <<<<<<<<<<<<<<
9732 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
9733 : * else:
9734 : */
9735 99 : if (__pyx_v_qisF) {
9736 :
9737 : /* "scipy/linalg/_decomp_update.pyx":352
9738 : * # i.e. u -= q.dot(s)
9739 : * if qisF:
9740 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1) # <<<<<<<<<<<<<<
9741 : * else:
9742 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
9743 : */
9744 198 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_s, 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, 1);
9745 :
9746 : /* "scipy/linalg/_decomp_update.pyx":351
9747 : * # make u be the part of u that is not in span(q)
9748 : * # i.e. u -= q.dot(s)
9749 : * if qisF: # <<<<<<<<<<<<<<
9750 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
9751 : * else:
9752 : */
9753 99 : goto __pyx_L3;
9754 : }
9755 :
9756 : /* "scipy/linalg/_decomp_update.pyx":354
9757 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
9758 : * else:
9759 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1) # <<<<<<<<<<<<<<
9760 : * wnorm = nrm2(m, u, 1)
9761 : *
9762 : */
9763 : /*else*/ {
9764 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, 1);
9765 : }
9766 99 : __pyx_L3:;
9767 :
9768 : /* "scipy/linalg/_decomp_update.pyx":355
9769 : * else:
9770 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
9771 : * wnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
9772 : *
9773 : * if blas_t_less_than(inv_root2, wnorm):
9774 : */
9775 99 : __pyx_v_wnorm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
9776 :
9777 : /* "scipy/linalg/_decomp_update.pyx":357
9778 : * wnorm = nrm2(m, u, 1)
9779 : *
9780 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
9781 : * with cython.cdivision(True):
9782 : * scal(m, 1/wnorm, u, 1)
9783 : */
9784 99 : __pyx_t_1 = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
9785 99 : if (__pyx_t_1) {
9786 :
9787 : /* "scipy/linalg/_decomp_update.pyx":359
9788 : * if blas_t_less_than(inv_root2, wnorm):
9789 : * with cython.cdivision(True):
9790 : * scal(m, 1/wnorm, u, 1) # <<<<<<<<<<<<<<
9791 : * s[n] = wnorm
9792 : * return True
9793 : */
9794 20 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_float(__pyx_t_float_complex_from_parts(1, 0), __pyx_v_wnorm), __pyx_v_u, 1);
9795 :
9796 : /* "scipy/linalg/_decomp_update.pyx":360
9797 : * with cython.cdivision(True):
9798 : * scal(m, 1/wnorm, u, 1)
9799 : * s[n] = wnorm # <<<<<<<<<<<<<<
9800 : * return True
9801 : *
9802 : */
9803 10 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wnorm;
9804 :
9805 : /* "scipy/linalg/_decomp_update.pyx":361
9806 : * scal(m, 1/wnorm, u, 1)
9807 : * s[n] = wnorm
9808 : * return True # <<<<<<<<<<<<<<
9809 : *
9810 : * # if the above check failed, try one reorthogonalization
9811 : */
9812 10 : __pyx_r = 1;
9813 10 : goto __pyx_L0;
9814 :
9815 : /* "scipy/linalg/_decomp_update.pyx":357
9816 : * wnorm = nrm2(m, u, 1)
9817 : *
9818 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
9819 : * with cython.cdivision(True):
9820 : * scal(m, 1/wnorm, u, 1)
9821 : */
9822 : }
9823 :
9824 : /* "scipy/linalg/_decomp_update.pyx":364
9825 : *
9826 : * # if the above check failed, try one reorthogonalization
9827 : * if qisF: # <<<<<<<<<<<<<<
9828 : * if blas_t is float or blas_t is double:
9829 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9830 : */
9831 89 : if (__pyx_v_qisF) {
9832 :
9833 : /* "scipy/linalg/_decomp_update.pyx":368
9834 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9835 : * else:
9836 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
9837 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1)
9838 : * else:
9839 : */
9840 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_u, 1, __pyx_t_float_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
9841 :
9842 : /* "scipy/linalg/_decomp_update.pyx":369
9843 : * else:
9844 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9845 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
9846 : * else:
9847 : * if blas_t is float or blas_t is double:
9848 : */
9849 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, (__pyx_v_qs[1]), (__pyx_v_s + __pyx_v_n), 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, 1);
9850 :
9851 : /* "scipy/linalg/_decomp_update.pyx":364
9852 : *
9853 : * # if the above check failed, try one reorthogonalization
9854 : * if qisF: # <<<<<<<<<<<<<<
9855 : * if blas_t is float or blas_t is double:
9856 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
9857 : */
9858 89 : goto __pyx_L5;
9859 : }
9860 :
9861 : /* "scipy/linalg/_decomp_update.pyx":371
9862 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1)
9863 : * else:
9864 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
9865 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
9866 : * else:
9867 : */
9868 : /*else*/ {
9869 :
9870 : /* "scipy/linalg/_decomp_update.pyx":374
9871 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
9872 : * else:
9873 : * blas_t_conj(m, u, &ss) # <<<<<<<<<<<<<<
9874 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
9875 : * blas_t_conj(m, u, &ss)
9876 : */
9877 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, (&__pyx_v_ss));
9878 :
9879 : /* "scipy/linalg/_decomp_update.pyx":375
9880 : * else:
9881 : * blas_t_conj(m, u, &ss)
9882 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
9883 : * blas_t_conj(m, u, &ss)
9884 : * blas_t_conj(n, s+n, &ss)
9885 : */
9886 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_n, __pyx_v_u, 1, __pyx_t_float_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
9887 :
9888 : /* "scipy/linalg/_decomp_update.pyx":376
9889 : * blas_t_conj(m, u, &ss)
9890 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
9891 : * blas_t_conj(m, u, &ss) # <<<<<<<<<<<<<<
9892 : * blas_t_conj(n, s+n, &ss)
9893 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
9894 : */
9895 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, (&__pyx_v_ss));
9896 :
9897 : /* "scipy/linalg/_decomp_update.pyx":377
9898 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
9899 : * blas_t_conj(m, u, &ss)
9900 : * blas_t_conj(n, s+n, &ss) # <<<<<<<<<<<<<<
9901 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
9902 : * wpnorm = nrm2(m, u, 1)
9903 : */
9904 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, (__pyx_v_s + __pyx_v_n), (&__pyx_v_ss));
9905 :
9906 : /* "scipy/linalg/_decomp_update.pyx":378
9907 : * blas_t_conj(m, u, &ss)
9908 : * blas_t_conj(n, s+n, &ss)
9909 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
9910 : * wpnorm = nrm2(m, u, 1)
9911 : *
9912 : */
9913 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, 1);
9914 : }
9915 89 : __pyx_L5:;
9916 :
9917 : /* "scipy/linalg/_decomp_update.pyx":379
9918 : * blas_t_conj(n, s+n, &ss)
9919 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
9920 : * wpnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
9921 : *
9922 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9923 : */
9924 89 : __pyx_v_wpnorm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
9925 :
9926 : /* "scipy/linalg/_decomp_update.pyx":381
9927 : * wpnorm = nrm2(m, u, 1)
9928 : *
9929 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
9930 : * scal(m, 0, u, 1)
9931 : * axpy(n, 1, s, 1, s+n, 1)
9932 : */
9933 89 : __pyx_t_1 = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_wpnorm, __Pyx_c_prod_float(__pyx_v_wnorm, __pyx_v_inv_root2));
9934 89 : if (__pyx_t_1) {
9935 :
9936 : /* "scipy/linalg/_decomp_update.pyx":382
9937 : *
9938 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9939 : * scal(m, 0, u, 1) # <<<<<<<<<<<<<<
9940 : * axpy(n, 1, s, 1, s+n, 1)
9941 : * s[n] = 0
9942 : */
9943 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __pyx_t_float_complex_from_parts(0, 0), __pyx_v_u, 1);
9944 :
9945 : /* "scipy/linalg/_decomp_update.pyx":383
9946 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
9947 : * scal(m, 0, u, 1)
9948 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
9949 : * s[n] = 0
9950 : * return False
9951 : */
9952 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
9953 :
9954 : /* "scipy/linalg/_decomp_update.pyx":384
9955 : * scal(m, 0, u, 1)
9956 : * axpy(n, 1, s, 1, s+n, 1)
9957 : * s[n] = 0 # <<<<<<<<<<<<<<
9958 : * return False
9959 : *
9960 : */
9961 0 : (__pyx_v_s[__pyx_v_n]) = __pyx_t_float_complex_from_parts(0, 0);
9962 :
9963 : /* "scipy/linalg/_decomp_update.pyx":385
9964 : * axpy(n, 1, s, 1, s+n, 1)
9965 : * s[n] = 0
9966 : * return False # <<<<<<<<<<<<<<
9967 : *
9968 : * scal(m, 1/wpnorm, u, 1)
9969 : */
9970 0 : __pyx_r = 0;
9971 0 : goto __pyx_L0;
9972 :
9973 : /* "scipy/linalg/_decomp_update.pyx":381
9974 : * wpnorm = nrm2(m, u, 1)
9975 : *
9976 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
9977 : * scal(m, 0, u, 1)
9978 : * axpy(n, 1, s, 1, s+n, 1)
9979 : */
9980 : }
9981 :
9982 : /* "scipy/linalg/_decomp_update.pyx":387
9983 : * return False
9984 : *
9985 : * scal(m, 1/wpnorm, u, 1) # <<<<<<<<<<<<<<
9986 : * axpy(n, 1, s, 1, s+n, 1)
9987 : * s[n] = wpnorm
9988 : */
9989 89 : __pyx_t_2 = __pyx_t_double_complex_from_parts(1, 0);
9990 89 : __pyx_t_3 = __pyx_t_double_complex_from_parts(__Pyx_CREAL(__pyx_v_wpnorm), __Pyx_CIMAG(__pyx_v_wpnorm));
9991 89 : if (unlikely(__Pyx_c_is_zero_double(__pyx_t_3))) {
9992 : #ifdef WITH_THREAD
9993 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
9994 : #endif
9995 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
9996 : #ifdef WITH_THREAD
9997 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
9998 : #endif
9999 0 : __PYX_ERR(0, 387, __pyx_L1_error)
10000 : }
10001 89 : __pyx_t_4 = __Pyx_c_quot_double(__pyx_t_2, __pyx_t_3);
10002 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __pyx_t_float_complex_from_parts(__Pyx_CREAL(__pyx_t_4), __Pyx_CIMAG(__pyx_t_4)), __pyx_v_u, 1);
10003 :
10004 : /* "scipy/linalg/_decomp_update.pyx":388
10005 : *
10006 : * scal(m, 1/wpnorm, u, 1)
10007 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
10008 : * s[n] = wpnorm
10009 : * return True
10010 : */
10011 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
10012 :
10013 : /* "scipy/linalg/_decomp_update.pyx":389
10014 : * scal(m, 1/wpnorm, u, 1)
10015 : * axpy(n, 1, s, 1, s+n, 1)
10016 : * s[n] = wpnorm # <<<<<<<<<<<<<<
10017 : * return True
10018 : *
10019 : */
10020 89 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wpnorm;
10021 :
10022 : /* "scipy/linalg/_decomp_update.pyx":390
10023 : * axpy(n, 1, s, 1, s+n, 1)
10024 : * s[n] = wpnorm
10025 : * return True # <<<<<<<<<<<<<<
10026 : *
10027 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF,
10028 : */
10029 89 : __pyx_r = 1;
10030 89 : goto __pyx_L0;
10031 :
10032 : /* "scipy/linalg/_decomp_update.pyx":333
10033 : * #------------------------------------------------------------------------------
10034 : *
10035 : * cdef bint reorthx(int m, int n, blas_t* q, int* qs, bint qisF, int j, blas_t* u, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
10036 : * # U should be all zeros on entry., and m > 1
10037 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
10038 : */
10039 :
10040 : /* function exit code */
10041 0 : __pyx_L1_error:;
10042 : #ifdef WITH_THREAD
10043 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
10044 : #endif
10045 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorthx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10046 0 : __pyx_r = 0;
10047 : #ifdef WITH_THREAD
10048 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
10049 : #endif
10050 99 : __pyx_L0:;
10051 99 : return __pyx_r;
10052 : }
10053 :
10054 99 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, int __pyx_v_j, __pyx_t_double_complex *__pyx_v_u, __pyx_t_double_complex *__pyx_v_s) {
10055 99 : __pyx_t_double_complex __pyx_v_wnorm;
10056 99 : __pyx_t_double_complex __pyx_v_wpnorm;
10057 99 : char *__pyx_v_T;
10058 99 : char *__pyx_v_N;
10059 99 : char *__pyx_v_C;
10060 99 : int __pyx_v_ss;
10061 99 : __pyx_t_double_complex __pyx_v_inv_root2;
10062 99 : int __pyx_r;
10063 99 : int __pyx_t_1;
10064 99 : __pyx_t_double_complex __pyx_t_2;
10065 99 : int __pyx_lineno = 0;
10066 99 : const char *__pyx_filename = NULL;
10067 99 : int __pyx_clineno = 0;
10068 : #ifdef WITH_THREAD
10069 99 : PyGILState_STATE __pyx_gilstate_save;
10070 : #endif
10071 :
10072 : /* "scipy/linalg/_decomp_update.pyx":336
10073 : * # U should be all zeros on entry., and m > 1
10074 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
10075 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
10076 : * cdef char* N = 'N'
10077 : * cdef char* C = 'C'
10078 : */
10079 99 : __pyx_v_T = ((char *)"T");
10080 :
10081 : /* "scipy/linalg/_decomp_update.pyx":337
10082 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
10083 : * cdef char* T = 'T'
10084 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
10085 : * cdef char* C = 'C'
10086 : * cdef int ss = 1
10087 : */
10088 99 : __pyx_v_N = ((char *)"N");
10089 :
10090 : /* "scipy/linalg/_decomp_update.pyx":338
10091 : * cdef char* T = 'T'
10092 : * cdef char* N = 'N'
10093 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
10094 : * cdef int ss = 1
10095 : * cdef blas_t inv_root2 = M_SQRT1_2
10096 : */
10097 99 : __pyx_v_C = ((char *)"C");
10098 :
10099 : /* "scipy/linalg/_decomp_update.pyx":339
10100 : * cdef char* N = 'N'
10101 : * cdef char* C = 'C'
10102 : * cdef int ss = 1 # <<<<<<<<<<<<<<
10103 : * cdef blas_t inv_root2 = M_SQRT1_2
10104 : *
10105 : */
10106 99 : __pyx_v_ss = 1;
10107 :
10108 : /* "scipy/linalg/_decomp_update.pyx":340
10109 : * cdef char* C = 'C'
10110 : * cdef int ss = 1
10111 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
10112 : *
10113 : * # u starts out as the jth basis vector.
10114 : */
10115 99 : __pyx_v_inv_root2 = __pyx_t_double_complex_from_parts(M_SQRT1_2, 0);
10116 :
10117 : /* "scipy/linalg/_decomp_update.pyx":343
10118 : *
10119 : * # u starts out as the jth basis vector.
10120 : * u[j] = 1 # <<<<<<<<<<<<<<
10121 : *
10122 : * # s = Q.T.dot(u) = jth row of Q.
10123 : */
10124 99 : (__pyx_v_u[__pyx_v_j]) = __pyx_t_double_complex_from_parts(1, 0);
10125 :
10126 : /* "scipy/linalg/_decomp_update.pyx":346
10127 : *
10128 : * # s = Q.T.dot(u) = jth row of Q.
10129 : * copy(n, row(q, qs, j), qs[1], s, 1) # <<<<<<<<<<<<<<
10130 : * blas_t_conj(n, s, &ss)
10131 : *
10132 : */
10133 198 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_n, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_s, 1);
10134 :
10135 : /* "scipy/linalg/_decomp_update.pyx":347
10136 : * # s = Q.T.dot(u) = jth row of Q.
10137 : * copy(n, row(q, qs, j), qs[1], s, 1)
10138 : * blas_t_conj(n, s, &ss) # <<<<<<<<<<<<<<
10139 : *
10140 : * # make u be the part of u that is not in span(q)
10141 : */
10142 99 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_s, (&__pyx_v_ss));
10143 :
10144 : /* "scipy/linalg/_decomp_update.pyx":351
10145 : * # make u be the part of u that is not in span(q)
10146 : * # i.e. u -= q.dot(s)
10147 : * if qisF: # <<<<<<<<<<<<<<
10148 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
10149 : * else:
10150 : */
10151 99 : if (__pyx_v_qisF) {
10152 :
10153 : /* "scipy/linalg/_decomp_update.pyx":352
10154 : * # i.e. u -= q.dot(s)
10155 : * if qisF:
10156 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1) # <<<<<<<<<<<<<<
10157 : * else:
10158 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
10159 : */
10160 198 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_s, 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, 1);
10161 :
10162 : /* "scipy/linalg/_decomp_update.pyx":351
10163 : * # make u be the part of u that is not in span(q)
10164 : * # i.e. u -= q.dot(s)
10165 : * if qisF: # <<<<<<<<<<<<<<
10166 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
10167 : * else:
10168 : */
10169 99 : goto __pyx_L3;
10170 : }
10171 :
10172 : /* "scipy/linalg/_decomp_update.pyx":354
10173 : * gemv(N, m, n, -1, q, qs[1], s, 1, 1, u, 1)
10174 : * else:
10175 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1) # <<<<<<<<<<<<<<
10176 : * wnorm = nrm2(m, u, 1)
10177 : *
10178 : */
10179 : /*else*/ {
10180 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, 1);
10181 : }
10182 99 : __pyx_L3:;
10183 :
10184 : /* "scipy/linalg/_decomp_update.pyx":355
10185 : * else:
10186 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, 1)
10187 : * wnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
10188 : *
10189 : * if blas_t_less_than(inv_root2, wnorm):
10190 : */
10191 99 : __pyx_v_wnorm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
10192 :
10193 : /* "scipy/linalg/_decomp_update.pyx":357
10194 : * wnorm = nrm2(m, u, 1)
10195 : *
10196 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
10197 : * with cython.cdivision(True):
10198 : * scal(m, 1/wnorm, u, 1)
10199 : */
10200 99 : __pyx_t_1 = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
10201 99 : if (__pyx_t_1) {
10202 :
10203 : /* "scipy/linalg/_decomp_update.pyx":359
10204 : * if blas_t_less_than(inv_root2, wnorm):
10205 : * with cython.cdivision(True):
10206 : * scal(m, 1/wnorm, u, 1) # <<<<<<<<<<<<<<
10207 : * s[n] = wnorm
10208 : * return True
10209 : */
10210 20 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_double(__pyx_t_double_complex_from_parts(1, 0), __pyx_v_wnorm), __pyx_v_u, 1);
10211 :
10212 : /* "scipy/linalg/_decomp_update.pyx":360
10213 : * with cython.cdivision(True):
10214 : * scal(m, 1/wnorm, u, 1)
10215 : * s[n] = wnorm # <<<<<<<<<<<<<<
10216 : * return True
10217 : *
10218 : */
10219 10 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wnorm;
10220 :
10221 : /* "scipy/linalg/_decomp_update.pyx":361
10222 : * scal(m, 1/wnorm, u, 1)
10223 : * s[n] = wnorm
10224 : * return True # <<<<<<<<<<<<<<
10225 : *
10226 : * # if the above check failed, try one reorthogonalization
10227 : */
10228 10 : __pyx_r = 1;
10229 10 : goto __pyx_L0;
10230 :
10231 : /* "scipy/linalg/_decomp_update.pyx":357
10232 : * wnorm = nrm2(m, u, 1)
10233 : *
10234 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
10235 : * with cython.cdivision(True):
10236 : * scal(m, 1/wnorm, u, 1)
10237 : */
10238 : }
10239 :
10240 : /* "scipy/linalg/_decomp_update.pyx":364
10241 : *
10242 : * # if the above check failed, try one reorthogonalization
10243 : * if qisF: # <<<<<<<<<<<<<<
10244 : * if blas_t is float or blas_t is double:
10245 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
10246 : */
10247 89 : if (__pyx_v_qisF) {
10248 :
10249 : /* "scipy/linalg/_decomp_update.pyx":368
10250 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
10251 : * else:
10252 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
10253 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1)
10254 : * else:
10255 : */
10256 178 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_q, (__pyx_v_qs[1]), __pyx_v_u, 1, __pyx_t_double_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
10257 :
10258 : /* "scipy/linalg/_decomp_update.pyx":369
10259 : * else:
10260 : * gemv(C, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
10261 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
10262 : * else:
10263 : * if blas_t is float or blas_t is double:
10264 : */
10265 178 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, (__pyx_v_qs[1]), (__pyx_v_s + __pyx_v_n), 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, 1);
10266 :
10267 : /* "scipy/linalg/_decomp_update.pyx":364
10268 : *
10269 : * # if the above check failed, try one reorthogonalization
10270 : * if qisF: # <<<<<<<<<<<<<<
10271 : * if blas_t is float or blas_t is double:
10272 : * gemv(T, m, n, 1, q, qs[1], u, 1, 0, s+n, 1)
10273 : */
10274 89 : goto __pyx_L5;
10275 : }
10276 :
10277 : /* "scipy/linalg/_decomp_update.pyx":371
10278 : * gemv(N, m, n, -1, q, qs[1], s+n, 1, 1, u, 1)
10279 : * else:
10280 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
10281 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
10282 : * else:
10283 : */
10284 : /*else*/ {
10285 :
10286 : /* "scipy/linalg/_decomp_update.pyx":374
10287 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
10288 : * else:
10289 : * blas_t_conj(m, u, &ss) # <<<<<<<<<<<<<<
10290 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
10291 : * blas_t_conj(m, u, &ss)
10292 : */
10293 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, (&__pyx_v_ss));
10294 :
10295 : /* "scipy/linalg/_decomp_update.pyx":375
10296 : * else:
10297 : * blas_t_conj(m, u, &ss)
10298 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1) # <<<<<<<<<<<<<<
10299 : * blas_t_conj(m, u, &ss)
10300 : * blas_t_conj(n, s+n, &ss)
10301 : */
10302 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_n, __pyx_v_u, 1, __pyx_t_double_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
10303 :
10304 : /* "scipy/linalg/_decomp_update.pyx":376
10305 : * blas_t_conj(m, u, &ss)
10306 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
10307 : * blas_t_conj(m, u, &ss) # <<<<<<<<<<<<<<
10308 : * blas_t_conj(n, s+n, &ss)
10309 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
10310 : */
10311 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, (&__pyx_v_ss));
10312 :
10313 : /* "scipy/linalg/_decomp_update.pyx":377
10314 : * gemv(N, n, m, 1, q, n, u, 1, 0, s+n, 1)
10315 : * blas_t_conj(m, u, &ss)
10316 : * blas_t_conj(n, s+n, &ss) # <<<<<<<<<<<<<<
10317 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
10318 : * wpnorm = nrm2(m, u, 1)
10319 : */
10320 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, (__pyx_v_s + __pyx_v_n), (&__pyx_v_ss));
10321 :
10322 : /* "scipy/linalg/_decomp_update.pyx":378
10323 : * blas_t_conj(m, u, &ss)
10324 : * blas_t_conj(n, s+n, &ss)
10325 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1) # <<<<<<<<<<<<<<
10326 : * wpnorm = nrm2(m, u, 1)
10327 : *
10328 : */
10329 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, 1);
10330 : }
10331 89 : __pyx_L5:;
10332 :
10333 : /* "scipy/linalg/_decomp_update.pyx":379
10334 : * blas_t_conj(n, s+n, &ss)
10335 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, 1)
10336 : * wpnorm = nrm2(m, u, 1) # <<<<<<<<<<<<<<
10337 : *
10338 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
10339 : */
10340 89 : __pyx_v_wpnorm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, 1);
10341 :
10342 : /* "scipy/linalg/_decomp_update.pyx":381
10343 : * wpnorm = nrm2(m, u, 1)
10344 : *
10345 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
10346 : * scal(m, 0, u, 1)
10347 : * axpy(n, 1, s, 1, s+n, 1)
10348 : */
10349 89 : __pyx_t_1 = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_wpnorm, __Pyx_c_prod_double(__pyx_v_wnorm, __pyx_v_inv_root2));
10350 89 : if (__pyx_t_1) {
10351 :
10352 : /* "scipy/linalg/_decomp_update.pyx":382
10353 : *
10354 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
10355 : * scal(m, 0, u, 1) # <<<<<<<<<<<<<<
10356 : * axpy(n, 1, s, 1, s+n, 1)
10357 : * s[n] = 0
10358 : */
10359 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __pyx_t_double_complex_from_parts(0, 0), __pyx_v_u, 1);
10360 :
10361 : /* "scipy/linalg/_decomp_update.pyx":383
10362 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q)
10363 : * scal(m, 0, u, 1)
10364 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
10365 : * s[n] = 0
10366 : * return False
10367 : */
10368 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
10369 :
10370 : /* "scipy/linalg/_decomp_update.pyx":384
10371 : * scal(m, 0, u, 1)
10372 : * axpy(n, 1, s, 1, s+n, 1)
10373 : * s[n] = 0 # <<<<<<<<<<<<<<
10374 : * return False
10375 : *
10376 : */
10377 0 : (__pyx_v_s[__pyx_v_n]) = __pyx_t_double_complex_from_parts(0, 0);
10378 :
10379 : /* "scipy/linalg/_decomp_update.pyx":385
10380 : * axpy(n, 1, s, 1, s+n, 1)
10381 : * s[n] = 0
10382 : * return False # <<<<<<<<<<<<<<
10383 : *
10384 : * scal(m, 1/wpnorm, u, 1)
10385 : */
10386 0 : __pyx_r = 0;
10387 0 : goto __pyx_L0;
10388 :
10389 : /* "scipy/linalg/_decomp_update.pyx":381
10390 : * wpnorm = nrm2(m, u, 1)
10391 : *
10392 : * if blas_t_less_than(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
10393 : * scal(m, 0, u, 1)
10394 : * axpy(n, 1, s, 1, s+n, 1)
10395 : */
10396 : }
10397 :
10398 : /* "scipy/linalg/_decomp_update.pyx":387
10399 : * return False
10400 : *
10401 : * scal(m, 1/wpnorm, u, 1) # <<<<<<<<<<<<<<
10402 : * axpy(n, 1, s, 1, s+n, 1)
10403 : * s[n] = wpnorm
10404 : */
10405 89 : __pyx_t_2 = __pyx_t_double_complex_from_parts(1, 0);
10406 89 : if (unlikely(__Pyx_c_is_zero_double(__pyx_v_wpnorm))) {
10407 : #ifdef WITH_THREAD
10408 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
10409 : #endif
10410 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
10411 : #ifdef WITH_THREAD
10412 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
10413 : #endif
10414 0 : __PYX_ERR(0, 387, __pyx_L1_error)
10415 : }
10416 89 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_double(__pyx_t_2, __pyx_v_wpnorm), __pyx_v_u, 1);
10417 :
10418 : /* "scipy/linalg/_decomp_update.pyx":388
10419 : *
10420 : * scal(m, 1/wpnorm, u, 1)
10421 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
10422 : * s[n] = wpnorm
10423 : * return True
10424 : */
10425 178 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
10426 :
10427 : /* "scipy/linalg/_decomp_update.pyx":389
10428 : * scal(m, 1/wpnorm, u, 1)
10429 : * axpy(n, 1, s, 1, s+n, 1)
10430 : * s[n] = wpnorm # <<<<<<<<<<<<<<
10431 : * return True
10432 : *
10433 : */
10434 89 : (__pyx_v_s[__pyx_v_n]) = __pyx_v_wpnorm;
10435 :
10436 : /* "scipy/linalg/_decomp_update.pyx":390
10437 : * axpy(n, 1, s, 1, s+n, 1)
10438 : * s[n] = wpnorm
10439 : * return True # <<<<<<<<<<<<<<
10440 : *
10441 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF,
10442 : */
10443 89 : __pyx_r = 1;
10444 89 : goto __pyx_L0;
10445 :
10446 : /* "scipy/linalg/_decomp_update.pyx":333
10447 : * #------------------------------------------------------------------------------
10448 : *
10449 : * cdef bint reorthx(int m, int n, blas_t* q, int* qs, bint qisF, int j, blas_t* u, blas_t* s) noexcept nogil: # <<<<<<<<<<<<<<
10450 : * # U should be all zeros on entry., and m > 1
10451 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
10452 : */
10453 :
10454 : /* function exit code */
10455 0 : __pyx_L1_error:;
10456 : #ifdef WITH_THREAD
10457 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
10458 : #endif
10459 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorthx", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10460 0 : __pyx_r = 0;
10461 : #ifdef WITH_THREAD
10462 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
10463 : #endif
10464 99 : __pyx_L0:;
10465 99 : return __pyx_r;
10466 : }
10467 :
10468 : /* "scipy/linalg/_decomp_update.pyx":392
10469 : * return True
10470 : *
10471 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
10472 : * blas_t* r, int* rs, int k, int p_eco,
10473 : * int p_full) noexcept nogil:
10474 : */
10475 :
10476 29 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full) {
10477 29 : CYTHON_UNUSED int __pyx_v_i;
10478 29 : int __pyx_v_j;
10479 29 : int __pyx_v_argmin_row_norm;
10480 29 : size_t __pyx_v_usize;
10481 29 : float *__pyx_v_s;
10482 29 : float *__pyx_v_u;
10483 29 : int __pyx_v_us[2];
10484 29 : int __pyx_v_ss[2];
10485 29 : float __pyx_v_c;
10486 29 : float __pyx_v_sn;
10487 29 : float __pyx_v_min_row_norm;
10488 29 : float __pyx_v_row_norm;
10489 29 : int __pyx_r;
10490 29 : int __pyx_t_1;
10491 29 : int __pyx_t_2;
10492 29 : int __pyx_t_3;
10493 29 : int __pyx_t_4;
10494 29 : long __pyx_t_5;
10495 29 : long __pyx_t_6;
10496 29 : int __pyx_t_7;
10497 29 : int __pyx_t_8;
10498 29 : int __pyx_t_9;
10499 :
10500 : /* "scipy/linalg/_decomp_update.pyx":396
10501 : * int p_full) noexcept nogil:
10502 : * cdef int i, j, argmin_row_norm
10503 : * cdef size_t usize = (m + 3*n + 1) * sizeof(blas_t) # <<<<<<<<<<<<<<
10504 : * cdef blas_t* s
10505 : * cdef blas_t* u
10506 : */
10507 29 : __pyx_v_usize = (((__pyx_v_m + (3 * __pyx_v_n)) + 1) * (sizeof(float)));
10508 :
10509 : /* "scipy/linalg/_decomp_update.pyx":404
10510 : * cdef blas_t c, sn, min_row_norm, row_norm
10511 : *
10512 : * u = <blas_t*>libc.stdlib.malloc(usize) # <<<<<<<<<<<<<<
10513 : * if not u:
10514 : * return MEMORY_ERROR
10515 : */
10516 29 : __pyx_v_u = ((float *)malloc(__pyx_v_usize));
10517 :
10518 : /* "scipy/linalg/_decomp_update.pyx":405
10519 : *
10520 : * u = <blas_t*>libc.stdlib.malloc(usize)
10521 : * if not u: # <<<<<<<<<<<<<<
10522 : * return MEMORY_ERROR
10523 : * s = u + m
10524 : */
10525 29 : __pyx_t_1 = (!(__pyx_v_u != 0));
10526 29 : if (__pyx_t_1) {
10527 :
10528 : /* "scipy/linalg/_decomp_update.pyx":406
10529 : * u = <blas_t*>libc.stdlib.malloc(usize)
10530 : * if not u:
10531 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
10532 : * s = u + m
10533 : * ss[0] = 1
10534 : */
10535 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
10536 0 : goto __pyx_L0;
10537 :
10538 : /* "scipy/linalg/_decomp_update.pyx":405
10539 : *
10540 : * u = <blas_t*>libc.stdlib.malloc(usize)
10541 : * if not u: # <<<<<<<<<<<<<<
10542 : * return MEMORY_ERROR
10543 : * s = u + m
10544 : */
10545 : }
10546 :
10547 : /* "scipy/linalg/_decomp_update.pyx":407
10548 : * if not u:
10549 : * return MEMORY_ERROR
10550 : * s = u + m # <<<<<<<<<<<<<<
10551 : * ss[0] = 1
10552 : * ss[1] = 0
10553 : */
10554 29 : __pyx_v_s = (__pyx_v_u + __pyx_v_m);
10555 :
10556 : /* "scipy/linalg/_decomp_update.pyx":408
10557 : * return MEMORY_ERROR
10558 : * s = u + m
10559 : * ss[0] = 1 # <<<<<<<<<<<<<<
10560 : * ss[1] = 0
10561 : * us[0] = 1
10562 : */
10563 29 : (__pyx_v_ss[0]) = 1;
10564 :
10565 : /* "scipy/linalg/_decomp_update.pyx":409
10566 : * s = u + m
10567 : * ss[0] = 1
10568 : * ss[1] = 0 # <<<<<<<<<<<<<<
10569 : * us[0] = 1
10570 : * us[1] = 0
10571 : */
10572 29 : (__pyx_v_ss[1]) = 0;
10573 :
10574 : /* "scipy/linalg/_decomp_update.pyx":410
10575 : * ss[0] = 1
10576 : * ss[1] = 0
10577 : * us[0] = 1 # <<<<<<<<<<<<<<
10578 : * us[1] = 0
10579 : *
10580 : */
10581 29 : (__pyx_v_us[0]) = 1;
10582 :
10583 : /* "scipy/linalg/_decomp_update.pyx":411
10584 : * ss[1] = 0
10585 : * us[0] = 1
10586 : * us[1] = 0 # <<<<<<<<<<<<<<
10587 : *
10588 : * for i in range(p_eco):
10589 : */
10590 29 : (__pyx_v_us[1]) = 0;
10591 :
10592 : /* "scipy/linalg/_decomp_update.pyx":413
10593 : * us[1] = 0
10594 : *
10595 : * for i in range(p_eco): # <<<<<<<<<<<<<<
10596 : * memset(u, 0, usize)
10597 : * # permute q such that row k is the last row.
10598 : */
10599 29 : __pyx_t_2 = __pyx_v_p_eco;
10600 29 : __pyx_t_3 = __pyx_t_2;
10601 128 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
10602 99 : __pyx_v_i = __pyx_t_4;
10603 :
10604 : /* "scipy/linalg/_decomp_update.pyx":414
10605 : *
10606 : * for i in range(p_eco):
10607 : * memset(u, 0, usize) # <<<<<<<<<<<<<<
10608 : * # permute q such that row k is the last row.
10609 : * if k != m-1:
10610 : */
10611 99 : (void)(memset(__pyx_v_u, 0, __pyx_v_usize));
10612 :
10613 : /* "scipy/linalg/_decomp_update.pyx":416
10614 : * memset(u, 0, usize)
10615 : * # permute q such that row k is the last row.
10616 : * if k != m-1: # <<<<<<<<<<<<<<
10617 : * for j in range(k, m-1):
10618 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
10619 : */
10620 99 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - 1));
10621 99 : if (__pyx_t_1) {
10622 :
10623 : /* "scipy/linalg/_decomp_update.pyx":417
10624 : * # permute q such that row k is the last row.
10625 : * if k != m-1:
10626 : * for j in range(k, m-1): # <<<<<<<<<<<<<<
10627 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
10628 : *
10629 : */
10630 747 : __pyx_t_5 = (__pyx_v_m - 1);
10631 : __pyx_t_6 = __pyx_t_5;
10632 747 : for (__pyx_t_7 = __pyx_v_k; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
10633 648 : __pyx_v_j = __pyx_t_7;
10634 :
10635 : /* "scipy/linalg/_decomp_update.pyx":418
10636 : * if k != m-1:
10637 : * for j in range(k, m-1):
10638 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1]) # <<<<<<<<<<<<<<
10639 : *
10640 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s):
10641 : */
10642 648 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[1]));
10643 : }
10644 :
10645 : /* "scipy/linalg/_decomp_update.pyx":416
10646 : * memset(u, 0, usize)
10647 : * # permute q such that row k is the last row.
10648 : * if k != m-1: # <<<<<<<<<<<<<<
10649 : * for j in range(k, m-1):
10650 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
10651 : */
10652 : }
10653 :
10654 : /* "scipy/linalg/_decomp_update.pyx":420
10655 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
10656 : *
10657 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
10658 : * # if we get here it means that this basis vector lies in span(q).
10659 : * # we want to use s[:n+1] but we need a vector into null(q)
10660 : */
10661 99 : __pyx_t_1 = (!__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, (__pyx_v_m - 1), __pyx_v_u, __pyx_v_s));
10662 99 : if (__pyx_t_1) {
10663 :
10664 : /* "scipy/linalg/_decomp_update.pyx":424
10665 : * # we want to use s[:n+1] but we need a vector into null(q)
10666 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
10667 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1]) # <<<<<<<<<<<<<<
10668 : * argmin_row_norm = 0
10669 : * for j in range(1, m):
10670 : */
10671 0 : __pyx_v_min_row_norm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, 0), (__pyx_v_qs[1]));
10672 :
10673 : /* "scipy/linalg/_decomp_update.pyx":425
10674 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
10675 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
10676 : * argmin_row_norm = 0 # <<<<<<<<<<<<<<
10677 : * for j in range(1, m):
10678 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
10679 : */
10680 0 : __pyx_v_argmin_row_norm = 0;
10681 :
10682 : /* "scipy/linalg/_decomp_update.pyx":426
10683 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
10684 : * argmin_row_norm = 0
10685 : * for j in range(1, m): # <<<<<<<<<<<<<<
10686 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
10687 : * if blas_t_less_than(row_norm, min_row_norm):
10688 : */
10689 0 : __pyx_t_7 = __pyx_v_m;
10690 0 : __pyx_t_8 = __pyx_t_7;
10691 0 : for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10692 0 : __pyx_v_j = __pyx_t_9;
10693 :
10694 : /* "scipy/linalg/_decomp_update.pyx":427
10695 : * argmin_row_norm = 0
10696 : * for j in range(1, m):
10697 : * row_norm = nrm2(n, row(q, qs, j), qs[1]) # <<<<<<<<<<<<<<
10698 : * if blas_t_less_than(row_norm, min_row_norm):
10699 : * min_row_norm = row_norm
10700 : */
10701 0 : __pyx_v_row_norm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]));
10702 :
10703 : /* "scipy/linalg/_decomp_update.pyx":428
10704 : * for j in range(1, m):
10705 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
10706 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
10707 : * min_row_norm = row_norm
10708 : * argmin_row_norm = j
10709 : */
10710 0 : __pyx_t_1 = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_row_norm, __pyx_v_min_row_norm);
10711 0 : if (__pyx_t_1) {
10712 :
10713 : /* "scipy/linalg/_decomp_update.pyx":429
10714 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
10715 : * if blas_t_less_than(row_norm, min_row_norm):
10716 : * min_row_norm = row_norm # <<<<<<<<<<<<<<
10717 : * argmin_row_norm = j
10718 : * memset(u, 0, m*sizeof(blas_t))
10719 : */
10720 0 : __pyx_v_min_row_norm = __pyx_v_row_norm;
10721 :
10722 : /* "scipy/linalg/_decomp_update.pyx":430
10723 : * if blas_t_less_than(row_norm, min_row_norm):
10724 : * min_row_norm = row_norm
10725 : * argmin_row_norm = j # <<<<<<<<<<<<<<
10726 : * memset(u, 0, m*sizeof(blas_t))
10727 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
10728 : */
10729 0 : __pyx_v_argmin_row_norm = __pyx_v_j;
10730 :
10731 : /* "scipy/linalg/_decomp_update.pyx":428
10732 : * for j in range(1, m):
10733 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
10734 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
10735 : * min_row_norm = row_norm
10736 : * argmin_row_norm = j
10737 : */
10738 : }
10739 : }
10740 :
10741 : /* "scipy/linalg/_decomp_update.pyx":431
10742 : * min_row_norm = row_norm
10743 : * argmin_row_norm = j
10744 : * memset(u, 0, m*sizeof(blas_t)) # <<<<<<<<<<<<<<
10745 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
10746 : * # failed, quit.
10747 : */
10748 0 : (void)(memset(__pyx_v_u, 0, (__pyx_v_m * (sizeof(float)))));
10749 :
10750 : /* "scipy/linalg/_decomp_update.pyx":432
10751 : * argmin_row_norm = j
10752 : * memset(u, 0, m*sizeof(blas_t))
10753 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
10754 : * # failed, quit.
10755 : * libc.stdlib.free(u)
10756 : */
10757 0 : __pyx_t_1 = (!__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_argmin_row_norm, __pyx_v_u, __pyx_v_s));
10758 0 : if (__pyx_t_1) {
10759 :
10760 : /* "scipy/linalg/_decomp_update.pyx":434
10761 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
10762 : * # failed, quit.
10763 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
10764 : * return 0
10765 : * s[n] = 0
10766 : */
10767 0 : free(__pyx_v_u);
10768 :
10769 : /* "scipy/linalg/_decomp_update.pyx":435
10770 : * # failed, quit.
10771 : * libc.stdlib.free(u)
10772 : * return 0 # <<<<<<<<<<<<<<
10773 : * s[n] = 0
10774 : *
10775 : */
10776 0 : __pyx_r = 0;
10777 0 : goto __pyx_L0;
10778 :
10779 : /* "scipy/linalg/_decomp_update.pyx":432
10780 : * argmin_row_norm = j
10781 : * memset(u, 0, m*sizeof(blas_t))
10782 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
10783 : * # failed, quit.
10784 : * libc.stdlib.free(u)
10785 : */
10786 : }
10787 :
10788 : /* "scipy/linalg/_decomp_update.pyx":436
10789 : * libc.stdlib.free(u)
10790 : * return 0
10791 : * s[n] = 0 # <<<<<<<<<<<<<<
10792 : *
10793 : * memset(s+2*n, 0, n*sizeof(blas_t))
10794 : */
10795 0 : (__pyx_v_s[__pyx_v_n]) = 0.0;
10796 :
10797 : /* "scipy/linalg/_decomp_update.pyx":420
10798 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
10799 : *
10800 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
10801 : * # if we get here it means that this basis vector lies in span(q).
10802 : * # we want to use s[:n+1] but we need a vector into null(q)
10803 : */
10804 : }
10805 :
10806 : /* "scipy/linalg/_decomp_update.pyx":438
10807 : * s[n] = 0
10808 : *
10809 : * memset(s+2*n, 0, n*sizeof(blas_t)) # <<<<<<<<<<<<<<
10810 : *
10811 : * # what happens here...
10812 : */
10813 99 : (void)(memset((__pyx_v_s + (2 * __pyx_v_n)), 0, (__pyx_v_n * (sizeof(float)))));
10814 :
10815 : /* "scipy/linalg/_decomp_update.pyx":441
10816 : *
10817 : * # what happens here...
10818 : * for j in range(n-1, -1, -1): # <<<<<<<<<<<<<<
10819 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
10820 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
10821 : */
10822 792 : for (__pyx_t_7 = (__pyx_v_n - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
10823 693 : __pyx_v_j = __pyx_t_7;
10824 :
10825 : /* "scipy/linalg/_decomp_update.pyx":442
10826 : * # what happens here...
10827 : * for j in range(n-1, -1, -1):
10828 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn) # <<<<<<<<<<<<<<
10829 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
10830 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
10831 : */
10832 693 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
10833 :
10834 : /* "scipy/linalg/_decomp_update.pyx":443
10835 : * for j in range(n-1, -1, -1):
10836 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
10837 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn) # <<<<<<<<<<<<<<
10838 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
10839 : * m -= 1
10840 : */
10841 693 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1((__pyx_v_s + (2 * __pyx_v_n)), __pyx_v_ss, __pyx_v_j), (__pyx_v_ss[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
10842 :
10843 : /* "scipy/linalg/_decomp_update.pyx":444
10844 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
10845 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
10846 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
10847 : * m -= 1
10848 : *
10849 : */
10850 693 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - 1), __pyx_v_u, (__pyx_v_us[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
10851 : }
10852 :
10853 : /* "scipy/linalg/_decomp_update.pyx":445
10854 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
10855 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
10856 : * m -= 1 # <<<<<<<<<<<<<<
10857 : *
10858 : * libc.stdlib.free(u)
10859 : */
10860 99 : __pyx_v_m = (__pyx_v_m - 1);
10861 : }
10862 :
10863 : /* "scipy/linalg/_decomp_update.pyx":447
10864 : * m -= 1
10865 : *
10866 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
10867 : *
10868 : * if p_full:
10869 : */
10870 29 : free(__pyx_v_u);
10871 :
10872 : /* "scipy/linalg/_decomp_update.pyx":449
10873 : * libc.stdlib.free(u)
10874 : *
10875 : * if p_full: # <<<<<<<<<<<<<<
10876 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
10877 : * return 1
10878 : */
10879 29 : __pyx_t_1 = (__pyx_v_p_full != 0);
10880 29 : if (__pyx_t_1) {
10881 :
10882 : /* "scipy/linalg/_decomp_update.pyx":450
10883 : *
10884 : * if p_full:
10885 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full) # <<<<<<<<<<<<<<
10886 : * return 1
10887 : *
10888 : */
10889 6 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p_full);
10890 :
10891 : /* "scipy/linalg/_decomp_update.pyx":449
10892 : * libc.stdlib.free(u)
10893 : *
10894 : * if p_full: # <<<<<<<<<<<<<<
10895 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
10896 : * return 1
10897 : */
10898 : }
10899 :
10900 : /* "scipy/linalg/_decomp_update.pyx":451
10901 : * if p_full:
10902 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
10903 : * return 1 # <<<<<<<<<<<<<<
10904 : *
10905 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs,
10906 : */
10907 29 : __pyx_r = 1;
10908 29 : goto __pyx_L0;
10909 :
10910 : /* "scipy/linalg/_decomp_update.pyx":392
10911 : * return True
10912 : *
10913 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
10914 : * blas_t* r, int* rs, int k, int p_eco,
10915 : * int p_full) noexcept nogil:
10916 : */
10917 :
10918 : /* function exit code */
10919 29 : __pyx_L0:;
10920 29 : return __pyx_r;
10921 : }
10922 :
10923 29 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full) {
10924 29 : CYTHON_UNUSED int __pyx_v_i;
10925 29 : int __pyx_v_j;
10926 29 : int __pyx_v_argmin_row_norm;
10927 29 : size_t __pyx_v_usize;
10928 29 : double *__pyx_v_s;
10929 29 : double *__pyx_v_u;
10930 29 : int __pyx_v_us[2];
10931 29 : int __pyx_v_ss[2];
10932 29 : double __pyx_v_c;
10933 29 : double __pyx_v_sn;
10934 29 : double __pyx_v_min_row_norm;
10935 29 : double __pyx_v_row_norm;
10936 29 : int __pyx_r;
10937 29 : int __pyx_t_1;
10938 29 : int __pyx_t_2;
10939 29 : int __pyx_t_3;
10940 29 : int __pyx_t_4;
10941 29 : long __pyx_t_5;
10942 29 : long __pyx_t_6;
10943 29 : int __pyx_t_7;
10944 29 : int __pyx_t_8;
10945 29 : int __pyx_t_9;
10946 :
10947 : /* "scipy/linalg/_decomp_update.pyx":396
10948 : * int p_full) noexcept nogil:
10949 : * cdef int i, j, argmin_row_norm
10950 : * cdef size_t usize = (m + 3*n + 1) * sizeof(blas_t) # <<<<<<<<<<<<<<
10951 : * cdef blas_t* s
10952 : * cdef blas_t* u
10953 : */
10954 29 : __pyx_v_usize = (((__pyx_v_m + (3 * __pyx_v_n)) + 1) * (sizeof(double)));
10955 :
10956 : /* "scipy/linalg/_decomp_update.pyx":404
10957 : * cdef blas_t c, sn, min_row_norm, row_norm
10958 : *
10959 : * u = <blas_t*>libc.stdlib.malloc(usize) # <<<<<<<<<<<<<<
10960 : * if not u:
10961 : * return MEMORY_ERROR
10962 : */
10963 29 : __pyx_v_u = ((double *)malloc(__pyx_v_usize));
10964 :
10965 : /* "scipy/linalg/_decomp_update.pyx":405
10966 : *
10967 : * u = <blas_t*>libc.stdlib.malloc(usize)
10968 : * if not u: # <<<<<<<<<<<<<<
10969 : * return MEMORY_ERROR
10970 : * s = u + m
10971 : */
10972 29 : __pyx_t_1 = (!(__pyx_v_u != 0));
10973 29 : if (__pyx_t_1) {
10974 :
10975 : /* "scipy/linalg/_decomp_update.pyx":406
10976 : * u = <blas_t*>libc.stdlib.malloc(usize)
10977 : * if not u:
10978 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
10979 : * s = u + m
10980 : * ss[0] = 1
10981 : */
10982 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
10983 0 : goto __pyx_L0;
10984 :
10985 : /* "scipy/linalg/_decomp_update.pyx":405
10986 : *
10987 : * u = <blas_t*>libc.stdlib.malloc(usize)
10988 : * if not u: # <<<<<<<<<<<<<<
10989 : * return MEMORY_ERROR
10990 : * s = u + m
10991 : */
10992 : }
10993 :
10994 : /* "scipy/linalg/_decomp_update.pyx":407
10995 : * if not u:
10996 : * return MEMORY_ERROR
10997 : * s = u + m # <<<<<<<<<<<<<<
10998 : * ss[0] = 1
10999 : * ss[1] = 0
11000 : */
11001 29 : __pyx_v_s = (__pyx_v_u + __pyx_v_m);
11002 :
11003 : /* "scipy/linalg/_decomp_update.pyx":408
11004 : * return MEMORY_ERROR
11005 : * s = u + m
11006 : * ss[0] = 1 # <<<<<<<<<<<<<<
11007 : * ss[1] = 0
11008 : * us[0] = 1
11009 : */
11010 29 : (__pyx_v_ss[0]) = 1;
11011 :
11012 : /* "scipy/linalg/_decomp_update.pyx":409
11013 : * s = u + m
11014 : * ss[0] = 1
11015 : * ss[1] = 0 # <<<<<<<<<<<<<<
11016 : * us[0] = 1
11017 : * us[1] = 0
11018 : */
11019 29 : (__pyx_v_ss[1]) = 0;
11020 :
11021 : /* "scipy/linalg/_decomp_update.pyx":410
11022 : * ss[0] = 1
11023 : * ss[1] = 0
11024 : * us[0] = 1 # <<<<<<<<<<<<<<
11025 : * us[1] = 0
11026 : *
11027 : */
11028 29 : (__pyx_v_us[0]) = 1;
11029 :
11030 : /* "scipy/linalg/_decomp_update.pyx":411
11031 : * ss[1] = 0
11032 : * us[0] = 1
11033 : * us[1] = 0 # <<<<<<<<<<<<<<
11034 : *
11035 : * for i in range(p_eco):
11036 : */
11037 29 : (__pyx_v_us[1]) = 0;
11038 :
11039 : /* "scipy/linalg/_decomp_update.pyx":413
11040 : * us[1] = 0
11041 : *
11042 : * for i in range(p_eco): # <<<<<<<<<<<<<<
11043 : * memset(u, 0, usize)
11044 : * # permute q such that row k is the last row.
11045 : */
11046 29 : __pyx_t_2 = __pyx_v_p_eco;
11047 29 : __pyx_t_3 = __pyx_t_2;
11048 128 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
11049 99 : __pyx_v_i = __pyx_t_4;
11050 :
11051 : /* "scipy/linalg/_decomp_update.pyx":414
11052 : *
11053 : * for i in range(p_eco):
11054 : * memset(u, 0, usize) # <<<<<<<<<<<<<<
11055 : * # permute q such that row k is the last row.
11056 : * if k != m-1:
11057 : */
11058 99 : (void)(memset(__pyx_v_u, 0, __pyx_v_usize));
11059 :
11060 : /* "scipy/linalg/_decomp_update.pyx":416
11061 : * memset(u, 0, usize)
11062 : * # permute q such that row k is the last row.
11063 : * if k != m-1: # <<<<<<<<<<<<<<
11064 : * for j in range(k, m-1):
11065 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11066 : */
11067 99 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - 1));
11068 99 : if (__pyx_t_1) {
11069 :
11070 : /* "scipy/linalg/_decomp_update.pyx":417
11071 : * # permute q such that row k is the last row.
11072 : * if k != m-1:
11073 : * for j in range(k, m-1): # <<<<<<<<<<<<<<
11074 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11075 : *
11076 : */
11077 747 : __pyx_t_5 = (__pyx_v_m - 1);
11078 : __pyx_t_6 = __pyx_t_5;
11079 747 : for (__pyx_t_7 = __pyx_v_k; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
11080 648 : __pyx_v_j = __pyx_t_7;
11081 :
11082 : /* "scipy/linalg/_decomp_update.pyx":418
11083 : * if k != m-1:
11084 : * for j in range(k, m-1):
11085 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1]) # <<<<<<<<<<<<<<
11086 : *
11087 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s):
11088 : */
11089 648 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[1]));
11090 : }
11091 :
11092 : /* "scipy/linalg/_decomp_update.pyx":416
11093 : * memset(u, 0, usize)
11094 : * # permute q such that row k is the last row.
11095 : * if k != m-1: # <<<<<<<<<<<<<<
11096 : * for j in range(k, m-1):
11097 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11098 : */
11099 : }
11100 :
11101 : /* "scipy/linalg/_decomp_update.pyx":420
11102 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11103 : *
11104 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
11105 : * # if we get here it means that this basis vector lies in span(q).
11106 : * # we want to use s[:n+1] but we need a vector into null(q)
11107 : */
11108 99 : __pyx_t_1 = (!__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, (__pyx_v_m - 1), __pyx_v_u, __pyx_v_s));
11109 99 : if (__pyx_t_1) {
11110 :
11111 : /* "scipy/linalg/_decomp_update.pyx":424
11112 : * # we want to use s[:n+1] but we need a vector into null(q)
11113 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
11114 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1]) # <<<<<<<<<<<<<<
11115 : * argmin_row_norm = 0
11116 : * for j in range(1, m):
11117 : */
11118 0 : __pyx_v_min_row_norm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, 0), (__pyx_v_qs[1]));
11119 :
11120 : /* "scipy/linalg/_decomp_update.pyx":425
11121 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
11122 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
11123 : * argmin_row_norm = 0 # <<<<<<<<<<<<<<
11124 : * for j in range(1, m):
11125 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11126 : */
11127 0 : __pyx_v_argmin_row_norm = 0;
11128 :
11129 : /* "scipy/linalg/_decomp_update.pyx":426
11130 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
11131 : * argmin_row_norm = 0
11132 : * for j in range(1, m): # <<<<<<<<<<<<<<
11133 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11134 : * if blas_t_less_than(row_norm, min_row_norm):
11135 : */
11136 0 : __pyx_t_7 = __pyx_v_m;
11137 0 : __pyx_t_8 = __pyx_t_7;
11138 0 : for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
11139 0 : __pyx_v_j = __pyx_t_9;
11140 :
11141 : /* "scipy/linalg/_decomp_update.pyx":427
11142 : * argmin_row_norm = 0
11143 : * for j in range(1, m):
11144 : * row_norm = nrm2(n, row(q, qs, j), qs[1]) # <<<<<<<<<<<<<<
11145 : * if blas_t_less_than(row_norm, min_row_norm):
11146 : * min_row_norm = row_norm
11147 : */
11148 0 : __pyx_v_row_norm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]));
11149 :
11150 : /* "scipy/linalg/_decomp_update.pyx":428
11151 : * for j in range(1, m):
11152 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11153 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
11154 : * min_row_norm = row_norm
11155 : * argmin_row_norm = j
11156 : */
11157 0 : __pyx_t_1 = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_row_norm, __pyx_v_min_row_norm);
11158 0 : if (__pyx_t_1) {
11159 :
11160 : /* "scipy/linalg/_decomp_update.pyx":429
11161 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11162 : * if blas_t_less_than(row_norm, min_row_norm):
11163 : * min_row_norm = row_norm # <<<<<<<<<<<<<<
11164 : * argmin_row_norm = j
11165 : * memset(u, 0, m*sizeof(blas_t))
11166 : */
11167 0 : __pyx_v_min_row_norm = __pyx_v_row_norm;
11168 :
11169 : /* "scipy/linalg/_decomp_update.pyx":430
11170 : * if blas_t_less_than(row_norm, min_row_norm):
11171 : * min_row_norm = row_norm
11172 : * argmin_row_norm = j # <<<<<<<<<<<<<<
11173 : * memset(u, 0, m*sizeof(blas_t))
11174 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
11175 : */
11176 0 : __pyx_v_argmin_row_norm = __pyx_v_j;
11177 :
11178 : /* "scipy/linalg/_decomp_update.pyx":428
11179 : * for j in range(1, m):
11180 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11181 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
11182 : * min_row_norm = row_norm
11183 : * argmin_row_norm = j
11184 : */
11185 : }
11186 : }
11187 :
11188 : /* "scipy/linalg/_decomp_update.pyx":431
11189 : * min_row_norm = row_norm
11190 : * argmin_row_norm = j
11191 : * memset(u, 0, m*sizeof(blas_t)) # <<<<<<<<<<<<<<
11192 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
11193 : * # failed, quit.
11194 : */
11195 0 : (void)(memset(__pyx_v_u, 0, (__pyx_v_m * (sizeof(double)))));
11196 :
11197 : /* "scipy/linalg/_decomp_update.pyx":432
11198 : * argmin_row_norm = j
11199 : * memset(u, 0, m*sizeof(blas_t))
11200 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
11201 : * # failed, quit.
11202 : * libc.stdlib.free(u)
11203 : */
11204 0 : __pyx_t_1 = (!__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_argmin_row_norm, __pyx_v_u, __pyx_v_s));
11205 0 : if (__pyx_t_1) {
11206 :
11207 : /* "scipy/linalg/_decomp_update.pyx":434
11208 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
11209 : * # failed, quit.
11210 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
11211 : * return 0
11212 : * s[n] = 0
11213 : */
11214 0 : free(__pyx_v_u);
11215 :
11216 : /* "scipy/linalg/_decomp_update.pyx":435
11217 : * # failed, quit.
11218 : * libc.stdlib.free(u)
11219 : * return 0 # <<<<<<<<<<<<<<
11220 : * s[n] = 0
11221 : *
11222 : */
11223 0 : __pyx_r = 0;
11224 0 : goto __pyx_L0;
11225 :
11226 : /* "scipy/linalg/_decomp_update.pyx":432
11227 : * argmin_row_norm = j
11228 : * memset(u, 0, m*sizeof(blas_t))
11229 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
11230 : * # failed, quit.
11231 : * libc.stdlib.free(u)
11232 : */
11233 : }
11234 :
11235 : /* "scipy/linalg/_decomp_update.pyx":436
11236 : * libc.stdlib.free(u)
11237 : * return 0
11238 : * s[n] = 0 # <<<<<<<<<<<<<<
11239 : *
11240 : * memset(s+2*n, 0, n*sizeof(blas_t))
11241 : */
11242 0 : (__pyx_v_s[__pyx_v_n]) = 0.0;
11243 :
11244 : /* "scipy/linalg/_decomp_update.pyx":420
11245 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11246 : *
11247 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
11248 : * # if we get here it means that this basis vector lies in span(q).
11249 : * # we want to use s[:n+1] but we need a vector into null(q)
11250 : */
11251 : }
11252 :
11253 : /* "scipy/linalg/_decomp_update.pyx":438
11254 : * s[n] = 0
11255 : *
11256 : * memset(s+2*n, 0, n*sizeof(blas_t)) # <<<<<<<<<<<<<<
11257 : *
11258 : * # what happens here...
11259 : */
11260 99 : (void)(memset((__pyx_v_s + (2 * __pyx_v_n)), 0, (__pyx_v_n * (sizeof(double)))));
11261 :
11262 : /* "scipy/linalg/_decomp_update.pyx":441
11263 : *
11264 : * # what happens here...
11265 : * for j in range(n-1, -1, -1): # <<<<<<<<<<<<<<
11266 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
11267 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11268 : */
11269 792 : for (__pyx_t_7 = (__pyx_v_n - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
11270 693 : __pyx_v_j = __pyx_t_7;
11271 :
11272 : /* "scipy/linalg/_decomp_update.pyx":442
11273 : * # what happens here...
11274 : * for j in range(n-1, -1, -1):
11275 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn) # <<<<<<<<<<<<<<
11276 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11277 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
11278 : */
11279 693 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
11280 :
11281 : /* "scipy/linalg/_decomp_update.pyx":443
11282 : * for j in range(n-1, -1, -1):
11283 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
11284 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn) # <<<<<<<<<<<<<<
11285 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
11286 : * m -= 1
11287 : */
11288 693 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1((__pyx_v_s + (2 * __pyx_v_n)), __pyx_v_ss, __pyx_v_j), (__pyx_v_ss[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
11289 :
11290 : /* "scipy/linalg/_decomp_update.pyx":444
11291 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
11292 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11293 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
11294 : * m -= 1
11295 : *
11296 : */
11297 693 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - 1), __pyx_v_u, (__pyx_v_us[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
11298 : }
11299 :
11300 : /* "scipy/linalg/_decomp_update.pyx":445
11301 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11302 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
11303 : * m -= 1 # <<<<<<<<<<<<<<
11304 : *
11305 : * libc.stdlib.free(u)
11306 : */
11307 99 : __pyx_v_m = (__pyx_v_m - 1);
11308 : }
11309 :
11310 : /* "scipy/linalg/_decomp_update.pyx":447
11311 : * m -= 1
11312 : *
11313 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
11314 : *
11315 : * if p_full:
11316 : */
11317 29 : free(__pyx_v_u);
11318 :
11319 : /* "scipy/linalg/_decomp_update.pyx":449
11320 : * libc.stdlib.free(u)
11321 : *
11322 : * if p_full: # <<<<<<<<<<<<<<
11323 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
11324 : * return 1
11325 : */
11326 29 : __pyx_t_1 = (__pyx_v_p_full != 0);
11327 29 : if (__pyx_t_1) {
11328 :
11329 : /* "scipy/linalg/_decomp_update.pyx":450
11330 : *
11331 : * if p_full:
11332 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full) # <<<<<<<<<<<<<<
11333 : * return 1
11334 : *
11335 : */
11336 6 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p_full);
11337 :
11338 : /* "scipy/linalg/_decomp_update.pyx":449
11339 : * libc.stdlib.free(u)
11340 : *
11341 : * if p_full: # <<<<<<<<<<<<<<
11342 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
11343 : * return 1
11344 : */
11345 : }
11346 :
11347 : /* "scipy/linalg/_decomp_update.pyx":451
11348 : * if p_full:
11349 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
11350 : * return 1 # <<<<<<<<<<<<<<
11351 : *
11352 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs,
11353 : */
11354 29 : __pyx_r = 1;
11355 29 : goto __pyx_L0;
11356 :
11357 : /* "scipy/linalg/_decomp_update.pyx":392
11358 : * return True
11359 : *
11360 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
11361 : * blas_t* r, int* rs, int k, int p_eco,
11362 : * int p_full) noexcept nogil:
11363 : */
11364 :
11365 : /* function exit code */
11366 29 : __pyx_L0:;
11367 29 : return __pyx_r;
11368 : }
11369 :
11370 29 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full) {
11371 29 : CYTHON_UNUSED int __pyx_v_i;
11372 29 : int __pyx_v_j;
11373 29 : int __pyx_v_argmin_row_norm;
11374 29 : size_t __pyx_v_usize;
11375 29 : __pyx_t_float_complex *__pyx_v_s;
11376 29 : __pyx_t_float_complex *__pyx_v_u;
11377 29 : int __pyx_v_us[2];
11378 29 : int __pyx_v_ss[2];
11379 29 : __pyx_t_float_complex __pyx_v_c;
11380 29 : __pyx_t_float_complex __pyx_v_sn;
11381 29 : __pyx_t_float_complex __pyx_v_min_row_norm;
11382 29 : __pyx_t_float_complex __pyx_v_row_norm;
11383 29 : int __pyx_r;
11384 29 : int __pyx_t_1;
11385 29 : int __pyx_t_2;
11386 29 : int __pyx_t_3;
11387 29 : int __pyx_t_4;
11388 29 : long __pyx_t_5;
11389 29 : long __pyx_t_6;
11390 29 : int __pyx_t_7;
11391 29 : int __pyx_t_8;
11392 29 : int __pyx_t_9;
11393 :
11394 : /* "scipy/linalg/_decomp_update.pyx":396
11395 : * int p_full) noexcept nogil:
11396 : * cdef int i, j, argmin_row_norm
11397 : * cdef size_t usize = (m + 3*n + 1) * sizeof(blas_t) # <<<<<<<<<<<<<<
11398 : * cdef blas_t* s
11399 : * cdef blas_t* u
11400 : */
11401 29 : __pyx_v_usize = (((__pyx_v_m + (3 * __pyx_v_n)) + 1) * (sizeof(__pyx_t_float_complex)));
11402 :
11403 : /* "scipy/linalg/_decomp_update.pyx":404
11404 : * cdef blas_t c, sn, min_row_norm, row_norm
11405 : *
11406 : * u = <blas_t*>libc.stdlib.malloc(usize) # <<<<<<<<<<<<<<
11407 : * if not u:
11408 : * return MEMORY_ERROR
11409 : */
11410 29 : __pyx_v_u = ((__pyx_t_float_complex *)malloc(__pyx_v_usize));
11411 :
11412 : /* "scipy/linalg/_decomp_update.pyx":405
11413 : *
11414 : * u = <blas_t*>libc.stdlib.malloc(usize)
11415 : * if not u: # <<<<<<<<<<<<<<
11416 : * return MEMORY_ERROR
11417 : * s = u + m
11418 : */
11419 29 : __pyx_t_1 = (!(__pyx_v_u != 0));
11420 29 : if (__pyx_t_1) {
11421 :
11422 : /* "scipy/linalg/_decomp_update.pyx":406
11423 : * u = <blas_t*>libc.stdlib.malloc(usize)
11424 : * if not u:
11425 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
11426 : * s = u + m
11427 : * ss[0] = 1
11428 : */
11429 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
11430 0 : goto __pyx_L0;
11431 :
11432 : /* "scipy/linalg/_decomp_update.pyx":405
11433 : *
11434 : * u = <blas_t*>libc.stdlib.malloc(usize)
11435 : * if not u: # <<<<<<<<<<<<<<
11436 : * return MEMORY_ERROR
11437 : * s = u + m
11438 : */
11439 : }
11440 :
11441 : /* "scipy/linalg/_decomp_update.pyx":407
11442 : * if not u:
11443 : * return MEMORY_ERROR
11444 : * s = u + m # <<<<<<<<<<<<<<
11445 : * ss[0] = 1
11446 : * ss[1] = 0
11447 : */
11448 29 : __pyx_v_s = (__pyx_v_u + __pyx_v_m);
11449 :
11450 : /* "scipy/linalg/_decomp_update.pyx":408
11451 : * return MEMORY_ERROR
11452 : * s = u + m
11453 : * ss[0] = 1 # <<<<<<<<<<<<<<
11454 : * ss[1] = 0
11455 : * us[0] = 1
11456 : */
11457 29 : (__pyx_v_ss[0]) = 1;
11458 :
11459 : /* "scipy/linalg/_decomp_update.pyx":409
11460 : * s = u + m
11461 : * ss[0] = 1
11462 : * ss[1] = 0 # <<<<<<<<<<<<<<
11463 : * us[0] = 1
11464 : * us[1] = 0
11465 : */
11466 29 : (__pyx_v_ss[1]) = 0;
11467 :
11468 : /* "scipy/linalg/_decomp_update.pyx":410
11469 : * ss[0] = 1
11470 : * ss[1] = 0
11471 : * us[0] = 1 # <<<<<<<<<<<<<<
11472 : * us[1] = 0
11473 : *
11474 : */
11475 29 : (__pyx_v_us[0]) = 1;
11476 :
11477 : /* "scipy/linalg/_decomp_update.pyx":411
11478 : * ss[1] = 0
11479 : * us[0] = 1
11480 : * us[1] = 0 # <<<<<<<<<<<<<<
11481 : *
11482 : * for i in range(p_eco):
11483 : */
11484 29 : (__pyx_v_us[1]) = 0;
11485 :
11486 : /* "scipy/linalg/_decomp_update.pyx":413
11487 : * us[1] = 0
11488 : *
11489 : * for i in range(p_eco): # <<<<<<<<<<<<<<
11490 : * memset(u, 0, usize)
11491 : * # permute q such that row k is the last row.
11492 : */
11493 29 : __pyx_t_2 = __pyx_v_p_eco;
11494 29 : __pyx_t_3 = __pyx_t_2;
11495 128 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
11496 99 : __pyx_v_i = __pyx_t_4;
11497 :
11498 : /* "scipy/linalg/_decomp_update.pyx":414
11499 : *
11500 : * for i in range(p_eco):
11501 : * memset(u, 0, usize) # <<<<<<<<<<<<<<
11502 : * # permute q such that row k is the last row.
11503 : * if k != m-1:
11504 : */
11505 99 : (void)(memset(__pyx_v_u, 0, __pyx_v_usize));
11506 :
11507 : /* "scipy/linalg/_decomp_update.pyx":416
11508 : * memset(u, 0, usize)
11509 : * # permute q such that row k is the last row.
11510 : * if k != m-1: # <<<<<<<<<<<<<<
11511 : * for j in range(k, m-1):
11512 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11513 : */
11514 99 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - 1));
11515 99 : if (__pyx_t_1) {
11516 :
11517 : /* "scipy/linalg/_decomp_update.pyx":417
11518 : * # permute q such that row k is the last row.
11519 : * if k != m-1:
11520 : * for j in range(k, m-1): # <<<<<<<<<<<<<<
11521 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11522 : *
11523 : */
11524 747 : __pyx_t_5 = (__pyx_v_m - 1);
11525 : __pyx_t_6 = __pyx_t_5;
11526 747 : for (__pyx_t_7 = __pyx_v_k; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
11527 648 : __pyx_v_j = __pyx_t_7;
11528 :
11529 : /* "scipy/linalg/_decomp_update.pyx":418
11530 : * if k != m-1:
11531 : * for j in range(k, m-1):
11532 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1]) # <<<<<<<<<<<<<<
11533 : *
11534 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s):
11535 : */
11536 648 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[1]));
11537 : }
11538 :
11539 : /* "scipy/linalg/_decomp_update.pyx":416
11540 : * memset(u, 0, usize)
11541 : * # permute q such that row k is the last row.
11542 : * if k != m-1: # <<<<<<<<<<<<<<
11543 : * for j in range(k, m-1):
11544 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11545 : */
11546 : }
11547 :
11548 : /* "scipy/linalg/_decomp_update.pyx":420
11549 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11550 : *
11551 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
11552 : * # if we get here it means that this basis vector lies in span(q).
11553 : * # we want to use s[:n+1] but we need a vector into null(q)
11554 : */
11555 99 : __pyx_t_1 = (!__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, (__pyx_v_m - 1), __pyx_v_u, __pyx_v_s));
11556 99 : if (__pyx_t_1) {
11557 :
11558 : /* "scipy/linalg/_decomp_update.pyx":424
11559 : * # we want to use s[:n+1] but we need a vector into null(q)
11560 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
11561 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1]) # <<<<<<<<<<<<<<
11562 : * argmin_row_norm = 0
11563 : * for j in range(1, m):
11564 : */
11565 0 : __pyx_v_min_row_norm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, 0), (__pyx_v_qs[1]));
11566 :
11567 : /* "scipy/linalg/_decomp_update.pyx":425
11568 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
11569 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
11570 : * argmin_row_norm = 0 # <<<<<<<<<<<<<<
11571 : * for j in range(1, m):
11572 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11573 : */
11574 0 : __pyx_v_argmin_row_norm = 0;
11575 :
11576 : /* "scipy/linalg/_decomp_update.pyx":426
11577 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
11578 : * argmin_row_norm = 0
11579 : * for j in range(1, m): # <<<<<<<<<<<<<<
11580 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11581 : * if blas_t_less_than(row_norm, min_row_norm):
11582 : */
11583 0 : __pyx_t_7 = __pyx_v_m;
11584 0 : __pyx_t_8 = __pyx_t_7;
11585 0 : for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
11586 0 : __pyx_v_j = __pyx_t_9;
11587 :
11588 : /* "scipy/linalg/_decomp_update.pyx":427
11589 : * argmin_row_norm = 0
11590 : * for j in range(1, m):
11591 : * row_norm = nrm2(n, row(q, qs, j), qs[1]) # <<<<<<<<<<<<<<
11592 : * if blas_t_less_than(row_norm, min_row_norm):
11593 : * min_row_norm = row_norm
11594 : */
11595 0 : __pyx_v_row_norm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]));
11596 :
11597 : /* "scipy/linalg/_decomp_update.pyx":428
11598 : * for j in range(1, m):
11599 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11600 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
11601 : * min_row_norm = row_norm
11602 : * argmin_row_norm = j
11603 : */
11604 0 : __pyx_t_1 = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_row_norm, __pyx_v_min_row_norm);
11605 0 : if (__pyx_t_1) {
11606 :
11607 : /* "scipy/linalg/_decomp_update.pyx":429
11608 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11609 : * if blas_t_less_than(row_norm, min_row_norm):
11610 : * min_row_norm = row_norm # <<<<<<<<<<<<<<
11611 : * argmin_row_norm = j
11612 : * memset(u, 0, m*sizeof(blas_t))
11613 : */
11614 0 : __pyx_v_min_row_norm = __pyx_v_row_norm;
11615 :
11616 : /* "scipy/linalg/_decomp_update.pyx":430
11617 : * if blas_t_less_than(row_norm, min_row_norm):
11618 : * min_row_norm = row_norm
11619 : * argmin_row_norm = j # <<<<<<<<<<<<<<
11620 : * memset(u, 0, m*sizeof(blas_t))
11621 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
11622 : */
11623 0 : __pyx_v_argmin_row_norm = __pyx_v_j;
11624 :
11625 : /* "scipy/linalg/_decomp_update.pyx":428
11626 : * for j in range(1, m):
11627 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
11628 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
11629 : * min_row_norm = row_norm
11630 : * argmin_row_norm = j
11631 : */
11632 : }
11633 : }
11634 :
11635 : /* "scipy/linalg/_decomp_update.pyx":431
11636 : * min_row_norm = row_norm
11637 : * argmin_row_norm = j
11638 : * memset(u, 0, m*sizeof(blas_t)) # <<<<<<<<<<<<<<
11639 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
11640 : * # failed, quit.
11641 : */
11642 0 : (void)(memset(__pyx_v_u, 0, (__pyx_v_m * (sizeof(__pyx_t_float_complex)))));
11643 :
11644 : /* "scipy/linalg/_decomp_update.pyx":432
11645 : * argmin_row_norm = j
11646 : * memset(u, 0, m*sizeof(blas_t))
11647 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
11648 : * # failed, quit.
11649 : * libc.stdlib.free(u)
11650 : */
11651 0 : __pyx_t_1 = (!__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_argmin_row_norm, __pyx_v_u, __pyx_v_s));
11652 0 : if (__pyx_t_1) {
11653 :
11654 : /* "scipy/linalg/_decomp_update.pyx":434
11655 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
11656 : * # failed, quit.
11657 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
11658 : * return 0
11659 : * s[n] = 0
11660 : */
11661 0 : free(__pyx_v_u);
11662 :
11663 : /* "scipy/linalg/_decomp_update.pyx":435
11664 : * # failed, quit.
11665 : * libc.stdlib.free(u)
11666 : * return 0 # <<<<<<<<<<<<<<
11667 : * s[n] = 0
11668 : *
11669 : */
11670 0 : __pyx_r = 0;
11671 0 : goto __pyx_L0;
11672 :
11673 : /* "scipy/linalg/_decomp_update.pyx":432
11674 : * argmin_row_norm = j
11675 : * memset(u, 0, m*sizeof(blas_t))
11676 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
11677 : * # failed, quit.
11678 : * libc.stdlib.free(u)
11679 : */
11680 : }
11681 :
11682 : /* "scipy/linalg/_decomp_update.pyx":436
11683 : * libc.stdlib.free(u)
11684 : * return 0
11685 : * s[n] = 0 # <<<<<<<<<<<<<<
11686 : *
11687 : * memset(s+2*n, 0, n*sizeof(blas_t))
11688 : */
11689 0 : (__pyx_v_s[__pyx_v_n]) = __pyx_t_float_complex_from_parts(0, 0);
11690 :
11691 : /* "scipy/linalg/_decomp_update.pyx":420
11692 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11693 : *
11694 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
11695 : * # if we get here it means that this basis vector lies in span(q).
11696 : * # we want to use s[:n+1] but we need a vector into null(q)
11697 : */
11698 : }
11699 :
11700 : /* "scipy/linalg/_decomp_update.pyx":438
11701 : * s[n] = 0
11702 : *
11703 : * memset(s+2*n, 0, n*sizeof(blas_t)) # <<<<<<<<<<<<<<
11704 : *
11705 : * # what happens here...
11706 : */
11707 99 : (void)(memset((__pyx_v_s + (2 * __pyx_v_n)), 0, (__pyx_v_n * (sizeof(__pyx_t_float_complex)))));
11708 :
11709 : /* "scipy/linalg/_decomp_update.pyx":441
11710 : *
11711 : * # what happens here...
11712 : * for j in range(n-1, -1, -1): # <<<<<<<<<<<<<<
11713 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
11714 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11715 : */
11716 792 : for (__pyx_t_7 = (__pyx_v_n - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
11717 693 : __pyx_v_j = __pyx_t_7;
11718 :
11719 : /* "scipy/linalg/_decomp_update.pyx":442
11720 : * # what happens here...
11721 : * for j in range(n-1, -1, -1):
11722 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn) # <<<<<<<<<<<<<<
11723 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11724 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
11725 : */
11726 693 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
11727 :
11728 : /* "scipy/linalg/_decomp_update.pyx":443
11729 : * for j in range(n-1, -1, -1):
11730 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
11731 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn) # <<<<<<<<<<<<<<
11732 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
11733 : * m -= 1
11734 : */
11735 693 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1((__pyx_v_s + (2 * __pyx_v_n)), __pyx_v_ss, __pyx_v_j), (__pyx_v_ss[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
11736 :
11737 : /* "scipy/linalg/_decomp_update.pyx":444
11738 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
11739 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11740 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
11741 : * m -= 1
11742 : *
11743 : */
11744 693 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - 1), __pyx_v_u, (__pyx_v_us[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_sn));
11745 : }
11746 :
11747 : /* "scipy/linalg/_decomp_update.pyx":445
11748 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
11749 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
11750 : * m -= 1 # <<<<<<<<<<<<<<
11751 : *
11752 : * libc.stdlib.free(u)
11753 : */
11754 99 : __pyx_v_m = (__pyx_v_m - 1);
11755 : }
11756 :
11757 : /* "scipy/linalg/_decomp_update.pyx":447
11758 : * m -= 1
11759 : *
11760 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
11761 : *
11762 : * if p_full:
11763 : */
11764 29 : free(__pyx_v_u);
11765 :
11766 : /* "scipy/linalg/_decomp_update.pyx":449
11767 : * libc.stdlib.free(u)
11768 : *
11769 : * if p_full: # <<<<<<<<<<<<<<
11770 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
11771 : * return 1
11772 : */
11773 29 : __pyx_t_1 = (__pyx_v_p_full != 0);
11774 29 : if (__pyx_t_1) {
11775 :
11776 : /* "scipy/linalg/_decomp_update.pyx":450
11777 : *
11778 : * if p_full:
11779 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full) # <<<<<<<<<<<<<<
11780 : * return 1
11781 : *
11782 : */
11783 6 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p_full);
11784 :
11785 : /* "scipy/linalg/_decomp_update.pyx":449
11786 : * libc.stdlib.free(u)
11787 : *
11788 : * if p_full: # <<<<<<<<<<<<<<
11789 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
11790 : * return 1
11791 : */
11792 : }
11793 :
11794 : /* "scipy/linalg/_decomp_update.pyx":451
11795 : * if p_full:
11796 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
11797 : * return 1 # <<<<<<<<<<<<<<
11798 : *
11799 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs,
11800 : */
11801 29 : __pyx_r = 1;
11802 29 : goto __pyx_L0;
11803 :
11804 : /* "scipy/linalg/_decomp_update.pyx":392
11805 : * return True
11806 : *
11807 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
11808 : * blas_t* r, int* rs, int k, int p_eco,
11809 : * int p_full) noexcept nogil:
11810 : */
11811 :
11812 : /* function exit code */
11813 29 : __pyx_L0:;
11814 29 : return __pyx_r;
11815 : }
11816 :
11817 29 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full) {
11818 29 : CYTHON_UNUSED int __pyx_v_i;
11819 29 : int __pyx_v_j;
11820 29 : int __pyx_v_argmin_row_norm;
11821 29 : size_t __pyx_v_usize;
11822 29 : __pyx_t_double_complex *__pyx_v_s;
11823 29 : __pyx_t_double_complex *__pyx_v_u;
11824 29 : int __pyx_v_us[2];
11825 29 : int __pyx_v_ss[2];
11826 29 : __pyx_t_double_complex __pyx_v_c;
11827 29 : __pyx_t_double_complex __pyx_v_sn;
11828 29 : __pyx_t_double_complex __pyx_v_min_row_norm;
11829 29 : __pyx_t_double_complex __pyx_v_row_norm;
11830 29 : int __pyx_r;
11831 29 : int __pyx_t_1;
11832 29 : int __pyx_t_2;
11833 29 : int __pyx_t_3;
11834 29 : int __pyx_t_4;
11835 29 : long __pyx_t_5;
11836 29 : long __pyx_t_6;
11837 29 : int __pyx_t_7;
11838 29 : int __pyx_t_8;
11839 29 : int __pyx_t_9;
11840 :
11841 : /* "scipy/linalg/_decomp_update.pyx":396
11842 : * int p_full) noexcept nogil:
11843 : * cdef int i, j, argmin_row_norm
11844 : * cdef size_t usize = (m + 3*n + 1) * sizeof(blas_t) # <<<<<<<<<<<<<<
11845 : * cdef blas_t* s
11846 : * cdef blas_t* u
11847 : */
11848 29 : __pyx_v_usize = (((__pyx_v_m + (3 * __pyx_v_n)) + 1) * (sizeof(__pyx_t_double_complex)));
11849 :
11850 : /* "scipy/linalg/_decomp_update.pyx":404
11851 : * cdef blas_t c, sn, min_row_norm, row_norm
11852 : *
11853 : * u = <blas_t*>libc.stdlib.malloc(usize) # <<<<<<<<<<<<<<
11854 : * if not u:
11855 : * return MEMORY_ERROR
11856 : */
11857 29 : __pyx_v_u = ((__pyx_t_double_complex *)malloc(__pyx_v_usize));
11858 :
11859 : /* "scipy/linalg/_decomp_update.pyx":405
11860 : *
11861 : * u = <blas_t*>libc.stdlib.malloc(usize)
11862 : * if not u: # <<<<<<<<<<<<<<
11863 : * return MEMORY_ERROR
11864 : * s = u + m
11865 : */
11866 29 : __pyx_t_1 = (!(__pyx_v_u != 0));
11867 29 : if (__pyx_t_1) {
11868 :
11869 : /* "scipy/linalg/_decomp_update.pyx":406
11870 : * u = <blas_t*>libc.stdlib.malloc(usize)
11871 : * if not u:
11872 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
11873 : * s = u + m
11874 : * ss[0] = 1
11875 : */
11876 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
11877 0 : goto __pyx_L0;
11878 :
11879 : /* "scipy/linalg/_decomp_update.pyx":405
11880 : *
11881 : * u = <blas_t*>libc.stdlib.malloc(usize)
11882 : * if not u: # <<<<<<<<<<<<<<
11883 : * return MEMORY_ERROR
11884 : * s = u + m
11885 : */
11886 : }
11887 :
11888 : /* "scipy/linalg/_decomp_update.pyx":407
11889 : * if not u:
11890 : * return MEMORY_ERROR
11891 : * s = u + m # <<<<<<<<<<<<<<
11892 : * ss[0] = 1
11893 : * ss[1] = 0
11894 : */
11895 29 : __pyx_v_s = (__pyx_v_u + __pyx_v_m);
11896 :
11897 : /* "scipy/linalg/_decomp_update.pyx":408
11898 : * return MEMORY_ERROR
11899 : * s = u + m
11900 : * ss[0] = 1 # <<<<<<<<<<<<<<
11901 : * ss[1] = 0
11902 : * us[0] = 1
11903 : */
11904 29 : (__pyx_v_ss[0]) = 1;
11905 :
11906 : /* "scipy/linalg/_decomp_update.pyx":409
11907 : * s = u + m
11908 : * ss[0] = 1
11909 : * ss[1] = 0 # <<<<<<<<<<<<<<
11910 : * us[0] = 1
11911 : * us[1] = 0
11912 : */
11913 29 : (__pyx_v_ss[1]) = 0;
11914 :
11915 : /* "scipy/linalg/_decomp_update.pyx":410
11916 : * ss[0] = 1
11917 : * ss[1] = 0
11918 : * us[0] = 1 # <<<<<<<<<<<<<<
11919 : * us[1] = 0
11920 : *
11921 : */
11922 29 : (__pyx_v_us[0]) = 1;
11923 :
11924 : /* "scipy/linalg/_decomp_update.pyx":411
11925 : * ss[1] = 0
11926 : * us[0] = 1
11927 : * us[1] = 0 # <<<<<<<<<<<<<<
11928 : *
11929 : * for i in range(p_eco):
11930 : */
11931 29 : (__pyx_v_us[1]) = 0;
11932 :
11933 : /* "scipy/linalg/_decomp_update.pyx":413
11934 : * us[1] = 0
11935 : *
11936 : * for i in range(p_eco): # <<<<<<<<<<<<<<
11937 : * memset(u, 0, usize)
11938 : * # permute q such that row k is the last row.
11939 : */
11940 29 : __pyx_t_2 = __pyx_v_p_eco;
11941 29 : __pyx_t_3 = __pyx_t_2;
11942 128 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
11943 99 : __pyx_v_i = __pyx_t_4;
11944 :
11945 : /* "scipy/linalg/_decomp_update.pyx":414
11946 : *
11947 : * for i in range(p_eco):
11948 : * memset(u, 0, usize) # <<<<<<<<<<<<<<
11949 : * # permute q such that row k is the last row.
11950 : * if k != m-1:
11951 : */
11952 99 : (void)(memset(__pyx_v_u, 0, __pyx_v_usize));
11953 :
11954 : /* "scipy/linalg/_decomp_update.pyx":416
11955 : * memset(u, 0, usize)
11956 : * # permute q such that row k is the last row.
11957 : * if k != m-1: # <<<<<<<<<<<<<<
11958 : * for j in range(k, m-1):
11959 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11960 : */
11961 99 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - 1));
11962 99 : if (__pyx_t_1) {
11963 :
11964 : /* "scipy/linalg/_decomp_update.pyx":417
11965 : * # permute q such that row k is the last row.
11966 : * if k != m-1:
11967 : * for j in range(k, m-1): # <<<<<<<<<<<<<<
11968 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11969 : *
11970 : */
11971 747 : __pyx_t_5 = (__pyx_v_m - 1);
11972 : __pyx_t_6 = __pyx_t_5;
11973 747 : for (__pyx_t_7 = __pyx_v_k; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
11974 648 : __pyx_v_j = __pyx_t_7;
11975 :
11976 : /* "scipy/linalg/_decomp_update.pyx":418
11977 : * if k != m-1:
11978 : * for j in range(k, m-1):
11979 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1]) # <<<<<<<<<<<<<<
11980 : *
11981 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s):
11982 : */
11983 648 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[1]));
11984 : }
11985 :
11986 : /* "scipy/linalg/_decomp_update.pyx":416
11987 : * memset(u, 0, usize)
11988 : * # permute q such that row k is the last row.
11989 : * if k != m-1: # <<<<<<<<<<<<<<
11990 : * for j in range(k, m-1):
11991 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11992 : */
11993 : }
11994 :
11995 : /* "scipy/linalg/_decomp_update.pyx":420
11996 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
11997 : *
11998 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
11999 : * # if we get here it means that this basis vector lies in span(q).
12000 : * # we want to use s[:n+1] but we need a vector into null(q)
12001 : */
12002 99 : __pyx_t_1 = (!__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, (__pyx_v_m - 1), __pyx_v_u, __pyx_v_s));
12003 99 : if (__pyx_t_1) {
12004 :
12005 : /* "scipy/linalg/_decomp_update.pyx":424
12006 : * # we want to use s[:n+1] but we need a vector into null(q)
12007 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
12008 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1]) # <<<<<<<<<<<<<<
12009 : * argmin_row_norm = 0
12010 : * for j in range(1, m):
12011 : */
12012 0 : __pyx_v_min_row_norm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, 0), (__pyx_v_qs[1]));
12013 :
12014 : /* "scipy/linalg/_decomp_update.pyx":425
12015 : * # find the row of q with the smallest norm and try that. (Daniel, p785)
12016 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
12017 : * argmin_row_norm = 0 # <<<<<<<<<<<<<<
12018 : * for j in range(1, m):
12019 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
12020 : */
12021 0 : __pyx_v_argmin_row_norm = 0;
12022 :
12023 : /* "scipy/linalg/_decomp_update.pyx":426
12024 : * min_row_norm = nrm2(n, row(q, qs, 0), qs[1])
12025 : * argmin_row_norm = 0
12026 : * for j in range(1, m): # <<<<<<<<<<<<<<
12027 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
12028 : * if blas_t_less_than(row_norm, min_row_norm):
12029 : */
12030 0 : __pyx_t_7 = __pyx_v_m;
12031 0 : __pyx_t_8 = __pyx_t_7;
12032 0 : for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
12033 0 : __pyx_v_j = __pyx_t_9;
12034 :
12035 : /* "scipy/linalg/_decomp_update.pyx":427
12036 : * argmin_row_norm = 0
12037 : * for j in range(1, m):
12038 : * row_norm = nrm2(n, row(q, qs, j), qs[1]) # <<<<<<<<<<<<<<
12039 : * if blas_t_less_than(row_norm, min_row_norm):
12040 : * min_row_norm = row_norm
12041 : */
12042 0 : __pyx_v_row_norm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]));
12043 :
12044 : /* "scipy/linalg/_decomp_update.pyx":428
12045 : * for j in range(1, m):
12046 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
12047 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
12048 : * min_row_norm = row_norm
12049 : * argmin_row_norm = j
12050 : */
12051 0 : __pyx_t_1 = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_row_norm, __pyx_v_min_row_norm);
12052 0 : if (__pyx_t_1) {
12053 :
12054 : /* "scipy/linalg/_decomp_update.pyx":429
12055 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
12056 : * if blas_t_less_than(row_norm, min_row_norm):
12057 : * min_row_norm = row_norm # <<<<<<<<<<<<<<
12058 : * argmin_row_norm = j
12059 : * memset(u, 0, m*sizeof(blas_t))
12060 : */
12061 0 : __pyx_v_min_row_norm = __pyx_v_row_norm;
12062 :
12063 : /* "scipy/linalg/_decomp_update.pyx":430
12064 : * if blas_t_less_than(row_norm, min_row_norm):
12065 : * min_row_norm = row_norm
12066 : * argmin_row_norm = j # <<<<<<<<<<<<<<
12067 : * memset(u, 0, m*sizeof(blas_t))
12068 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
12069 : */
12070 0 : __pyx_v_argmin_row_norm = __pyx_v_j;
12071 :
12072 : /* "scipy/linalg/_decomp_update.pyx":428
12073 : * for j in range(1, m):
12074 : * row_norm = nrm2(n, row(q, qs, j), qs[1])
12075 : * if blas_t_less_than(row_norm, min_row_norm): # <<<<<<<<<<<<<<
12076 : * min_row_norm = row_norm
12077 : * argmin_row_norm = j
12078 : */
12079 : }
12080 : }
12081 :
12082 : /* "scipy/linalg/_decomp_update.pyx":431
12083 : * min_row_norm = row_norm
12084 : * argmin_row_norm = j
12085 : * memset(u, 0, m*sizeof(blas_t)) # <<<<<<<<<<<<<<
12086 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
12087 : * # failed, quit.
12088 : */
12089 0 : (void)(memset(__pyx_v_u, 0, (__pyx_v_m * (sizeof(__pyx_t_double_complex)))));
12090 :
12091 : /* "scipy/linalg/_decomp_update.pyx":432
12092 : * argmin_row_norm = j
12093 : * memset(u, 0, m*sizeof(blas_t))
12094 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
12095 : * # failed, quit.
12096 : * libc.stdlib.free(u)
12097 : */
12098 0 : __pyx_t_1 = (!__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorthx(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_argmin_row_norm, __pyx_v_u, __pyx_v_s));
12099 0 : if (__pyx_t_1) {
12100 :
12101 : /* "scipy/linalg/_decomp_update.pyx":434
12102 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s):
12103 : * # failed, quit.
12104 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
12105 : * return 0
12106 : * s[n] = 0
12107 : */
12108 0 : free(__pyx_v_u);
12109 :
12110 : /* "scipy/linalg/_decomp_update.pyx":435
12111 : * # failed, quit.
12112 : * libc.stdlib.free(u)
12113 : * return 0 # <<<<<<<<<<<<<<
12114 : * s[n] = 0
12115 : *
12116 : */
12117 0 : __pyx_r = 0;
12118 0 : goto __pyx_L0;
12119 :
12120 : /* "scipy/linalg/_decomp_update.pyx":432
12121 : * argmin_row_norm = j
12122 : * memset(u, 0, m*sizeof(blas_t))
12123 : * if not reorthx(m, n, q, qs, qisF, argmin_row_norm, u, s): # <<<<<<<<<<<<<<
12124 : * # failed, quit.
12125 : * libc.stdlib.free(u)
12126 : */
12127 : }
12128 :
12129 : /* "scipy/linalg/_decomp_update.pyx":436
12130 : * libc.stdlib.free(u)
12131 : * return 0
12132 : * s[n] = 0 # <<<<<<<<<<<<<<
12133 : *
12134 : * memset(s+2*n, 0, n*sizeof(blas_t))
12135 : */
12136 0 : (__pyx_v_s[__pyx_v_n]) = __pyx_t_double_complex_from_parts(0, 0);
12137 :
12138 : /* "scipy/linalg/_decomp_update.pyx":420
12139 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j+1), qs[1])
12140 : *
12141 : * if not reorthx(m, n, q, qs, qisF, m-1, u, s): # <<<<<<<<<<<<<<
12142 : * # if we get here it means that this basis vector lies in span(q).
12143 : * # we want to use s[:n+1] but we need a vector into null(q)
12144 : */
12145 : }
12146 :
12147 : /* "scipy/linalg/_decomp_update.pyx":438
12148 : * s[n] = 0
12149 : *
12150 : * memset(s+2*n, 0, n*sizeof(blas_t)) # <<<<<<<<<<<<<<
12151 : *
12152 : * # what happens here...
12153 : */
12154 99 : (void)(memset((__pyx_v_s + (2 * __pyx_v_n)), 0, (__pyx_v_n * (sizeof(__pyx_t_double_complex)))));
12155 :
12156 : /* "scipy/linalg/_decomp_update.pyx":441
12157 : *
12158 : * # what happens here...
12159 : * for j in range(n-1, -1, -1): # <<<<<<<<<<<<<<
12160 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
12161 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
12162 : */
12163 792 : for (__pyx_t_7 = (__pyx_v_n - 1); __pyx_t_7 > -1; __pyx_t_7-=1) {
12164 693 : __pyx_v_j = __pyx_t_7;
12165 :
12166 : /* "scipy/linalg/_decomp_update.pyx":442
12167 : * # what happens here...
12168 : * for j in range(n-1, -1, -1):
12169 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn) # <<<<<<<<<<<<<<
12170 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
12171 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
12172 : */
12173 693 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
12174 :
12175 : /* "scipy/linalg/_decomp_update.pyx":443
12176 : * for j in range(n-1, -1, -1):
12177 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
12178 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn) # <<<<<<<<<<<<<<
12179 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
12180 : * m -= 1
12181 : */
12182 693 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1((__pyx_v_s + (2 * __pyx_v_n)), __pyx_v_ss, __pyx_v_j), (__pyx_v_ss[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
12183 :
12184 : /* "scipy/linalg/_decomp_update.pyx":444
12185 : * lartg(index1(s, ss, n), index1(s, ss, j), &c, &sn)
12186 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
12187 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
12188 : * m -= 1
12189 : *
12190 : */
12191 693 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - 1), __pyx_v_u, (__pyx_v_us[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_sn));
12192 : }
12193 :
12194 : /* "scipy/linalg/_decomp_update.pyx":445
12195 : * rot(n-j, index1(s+2*n, ss, j), ss[0], index2(r, rs,j, j), rs[1], c, sn)
12196 : * rot(m-1, u, us[0], col(q, qs, j), qs[0], c, sn.conjugate())
12197 : * m -= 1 # <<<<<<<<<<<<<<
12198 : *
12199 : * libc.stdlib.free(u)
12200 : */
12201 99 : __pyx_v_m = (__pyx_v_m - 1);
12202 : }
12203 :
12204 : /* "scipy/linalg/_decomp_update.pyx":447
12205 : * m -= 1
12206 : *
12207 : * libc.stdlib.free(u) # <<<<<<<<<<<<<<
12208 : *
12209 : * if p_full:
12210 : */
12211 29 : free(__pyx_v_u);
12212 :
12213 : /* "scipy/linalg/_decomp_update.pyx":449
12214 : * libc.stdlib.free(u)
12215 : *
12216 : * if p_full: # <<<<<<<<<<<<<<
12217 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
12218 : * return 1
12219 : */
12220 29 : __pyx_t_1 = (__pyx_v_p_full != 0);
12221 29 : if (__pyx_t_1) {
12222 :
12223 : /* "scipy/linalg/_decomp_update.pyx":450
12224 : *
12225 : * if p_full:
12226 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full) # <<<<<<<<<<<<<<
12227 : * return 1
12228 : *
12229 : */
12230 6 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p_full);
12231 :
12232 : /* "scipy/linalg/_decomp_update.pyx":449
12233 : * libc.stdlib.free(u)
12234 : *
12235 : * if p_full: # <<<<<<<<<<<<<<
12236 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
12237 : * return 1
12238 : */
12239 : }
12240 :
12241 : /* "scipy/linalg/_decomp_update.pyx":451
12242 : * if p_full:
12243 : * qr_block_row_delete(m, n, q, qs, r, rs, k, p_full)
12244 : * return 1 # <<<<<<<<<<<<<<
12245 : *
12246 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs,
12247 : */
12248 29 : __pyx_r = 1;
12249 29 : goto __pyx_L0;
12250 :
12251 : /* "scipy/linalg/_decomp_update.pyx":392
12252 : * return True
12253 : *
12254 : * cdef int thin_qr_row_delete(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
12255 : * blas_t* r, int* rs, int k, int p_eco,
12256 : * int p_full) noexcept nogil:
12257 : */
12258 :
12259 : /* function exit code */
12260 29 : __pyx_L0:;
12261 29 : return __pyx_r;
12262 : }
12263 :
12264 : /* "scipy/linalg/_decomp_update.pyx":453
12265 : * return 1
12266 : *
12267 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
12268 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
12269 : * cdef int i, j
12270 : */
12271 :
12272 288 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
12273 288 : int __pyx_v_i;
12274 288 : int __pyx_v_j;
12275 288 : float __pyx_v_c;
12276 288 : float __pyx_v_s;
12277 288 : float *__pyx_v_W;
12278 288 : int *__pyx_v_ws;
12279 288 : int __pyx_t_1;
12280 288 : int __pyx_t_2;
12281 288 : int __pyx_t_3;
12282 288 : int __pyx_t_4;
12283 288 : long __pyx_t_5;
12284 288 : long __pyx_t_6;
12285 288 : int __pyx_t_7;
12286 :
12287 : /* "scipy/linalg/_decomp_update.pyx":460
12288 : * cdef int* ws
12289 : *
12290 : * if k != 0: # <<<<<<<<<<<<<<
12291 : * for j in range(k, 0, -1):
12292 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12293 : */
12294 288 : __pyx_t_1 = (__pyx_v_k != 0);
12295 288 : if (__pyx_t_1) {
12296 :
12297 : /* "scipy/linalg/_decomp_update.pyx":461
12298 : *
12299 : * if k != 0:
12300 : * for j in range(k, 0, -1): # <<<<<<<<<<<<<<
12301 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12302 : *
12303 : */
12304 538 : for (__pyx_t_2 = __pyx_v_k; __pyx_t_2 > 0; __pyx_t_2-=1) {
12305 419 : __pyx_v_j = __pyx_t_2;
12306 :
12307 : /* "scipy/linalg/_decomp_update.pyx":462
12308 : * if k != 0:
12309 : * for j in range(k, 0, -1):
12310 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
12311 : *
12312 : * # W is the block of rows to be removed from q, has shape, (p,m)
12313 : */
12314 419 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, ((__pyx_v_j + __pyx_v_p) - 1)), (__pyx_v_qs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
12315 : }
12316 :
12317 : /* "scipy/linalg/_decomp_update.pyx":460
12318 : * cdef int* ws
12319 : *
12320 : * if k != 0: # <<<<<<<<<<<<<<
12321 : * for j in range(k, 0, -1):
12322 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12323 : */
12324 : }
12325 :
12326 : /* "scipy/linalg/_decomp_update.pyx":465
12327 : *
12328 : * # W is the block of rows to be removed from q, has shape, (p,m)
12329 : * W = q # <<<<<<<<<<<<<<
12330 : * ws = qs
12331 : *
12332 : */
12333 : __pyx_v_W = __pyx_v_q;
12334 :
12335 : /* "scipy/linalg/_decomp_update.pyx":466
12336 : * # W is the block of rows to be removed from q, has shape, (p,m)
12337 : * W = q
12338 : * ws = qs # <<<<<<<<<<<<<<
12339 : *
12340 : * for j in range(p):
12341 : */
12342 : __pyx_v_ws = __pyx_v_qs;
12343 :
12344 : /* "scipy/linalg/_decomp_update.pyx":468
12345 : * ws = qs
12346 : *
12347 : * for j in range(p): # <<<<<<<<<<<<<<
12348 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12349 : *
12350 : */
12351 288 : __pyx_t_2 = __pyx_v_p;
12352 : __pyx_t_3 = __pyx_t_2;
12353 288 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12354 : __pyx_v_j = __pyx_t_4;
12355 :
12356 : /* "scipy/linalg/_decomp_update.pyx":469
12357 : *
12358 : * for j in range(p):
12359 : * blas_t_conj(m, row(W, ws, j), &ws[1]) # <<<<<<<<<<<<<<
12360 : *
12361 : * for i in range(p):
12362 : */
12363 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_W, __pyx_v_ws, __pyx_v_j), (&(__pyx_v_ws[1])));
12364 : }
12365 :
12366 : /* "scipy/linalg/_decomp_update.pyx":471
12367 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12368 : *
12369 : * for i in range(p): # <<<<<<<<<<<<<<
12370 : * for j in range(m-2, i-1, -1):
12371 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12372 : */
12373 948 : __pyx_t_2 = __pyx_v_p;
12374 : __pyx_t_3 = __pyx_t_2;
12375 948 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12376 660 : __pyx_v_i = __pyx_t_4;
12377 :
12378 : /* "scipy/linalg/_decomp_update.pyx":472
12379 : *
12380 : * for i in range(p):
12381 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
12382 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12383 : *
12384 : */
12385 660 : __pyx_t_5 = (__pyx_v_i - 1);
12386 660 : __pyx_t_6 = __pyx_t_5;
12387 5346 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
12388 4686 : __pyx_v_j = __pyx_t_7;
12389 :
12390 : /* "scipy/linalg/_decomp_update.pyx":473
12391 : * for i in range(p):
12392 : * for j in range(m-2, i-1, -1):
12393 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s) # <<<<<<<<<<<<<<
12394 : *
12395 : * # update W
12396 : */
12397 4686 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
12398 :
12399 : /* "scipy/linalg/_decomp_update.pyx":476
12400 : *
12401 : * # update W
12402 : * if i+1 < p: # <<<<<<<<<<<<<<
12403 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
12404 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12405 : */
12406 4686 : __pyx_t_1 = ((__pyx_v_i + 1) < __pyx_v_p);
12407 4686 : if (__pyx_t_1) {
12408 :
12409 : /* "scipy/linalg/_decomp_update.pyx":477
12410 : * # update W
12411 : * if i+1 < p:
12412 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0], # <<<<<<<<<<<<<<
12413 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12414 : *
12415 : */
12416 2751 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), __pyx_v_j), (__pyx_v_ws[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), (__pyx_v_j + 1)), (__pyx_v_ws[0]), __pyx_v_c, __pyx_v_s);
12417 :
12418 : /* "scipy/linalg/_decomp_update.pyx":476
12419 : *
12420 : * # update W
12421 : * if i+1 < p: # <<<<<<<<<<<<<<
12422 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
12423 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12424 : */
12425 : }
12426 :
12427 : /* "scipy/linalg/_decomp_update.pyx":481
12428 : *
12429 : * # update r if there is a nonzero row.
12430 : * if j-i < n: # <<<<<<<<<<<<<<
12431 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
12432 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12433 : */
12434 4686 : __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < __pyx_v_n);
12435 4686 : if (__pyx_t_1) {
12436 :
12437 : /* "scipy/linalg/_decomp_update.pyx":482
12438 : * # update r if there is a nonzero row.
12439 : * if j-i < n:
12440 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1], # <<<<<<<<<<<<<<
12441 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12442 : *
12443 : */
12444 3694 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) + __pyx_v_i), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
12445 :
12446 : /* "scipy/linalg/_decomp_update.pyx":481
12447 : *
12448 : * # update r if there is a nonzero row.
12449 : * if j-i < n: # <<<<<<<<<<<<<<
12450 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
12451 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12452 : */
12453 : }
12454 :
12455 : /* "scipy/linalg/_decomp_update.pyx":486
12456 : *
12457 : * # update q
12458 : * rot(m-p, index2(q, qs, p, j), qs[0], index2(q, qs, p, j+1), qs[0], # <<<<<<<<<<<<<<
12459 : * c, s.conjugate())
12460 : *
12461 : */
12462 4686 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - __pyx_v_p), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
12463 : }
12464 : }
12465 :
12466 : /* "scipy/linalg/_decomp_update.pyx":453
12467 : * return 1
12468 : *
12469 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
12470 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
12471 : * cdef int i, j
12472 : */
12473 :
12474 : /* function exit code */
12475 288 : }
12476 :
12477 288 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
12478 288 : int __pyx_v_i;
12479 288 : int __pyx_v_j;
12480 288 : double __pyx_v_c;
12481 288 : double __pyx_v_s;
12482 288 : double *__pyx_v_W;
12483 288 : int *__pyx_v_ws;
12484 288 : int __pyx_t_1;
12485 288 : int __pyx_t_2;
12486 288 : int __pyx_t_3;
12487 288 : int __pyx_t_4;
12488 288 : long __pyx_t_5;
12489 288 : long __pyx_t_6;
12490 288 : int __pyx_t_7;
12491 :
12492 : /* "scipy/linalg/_decomp_update.pyx":460
12493 : * cdef int* ws
12494 : *
12495 : * if k != 0: # <<<<<<<<<<<<<<
12496 : * for j in range(k, 0, -1):
12497 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12498 : */
12499 288 : __pyx_t_1 = (__pyx_v_k != 0);
12500 288 : if (__pyx_t_1) {
12501 :
12502 : /* "scipy/linalg/_decomp_update.pyx":461
12503 : *
12504 : * if k != 0:
12505 : * for j in range(k, 0, -1): # <<<<<<<<<<<<<<
12506 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12507 : *
12508 : */
12509 538 : for (__pyx_t_2 = __pyx_v_k; __pyx_t_2 > 0; __pyx_t_2-=1) {
12510 419 : __pyx_v_j = __pyx_t_2;
12511 :
12512 : /* "scipy/linalg/_decomp_update.pyx":462
12513 : * if k != 0:
12514 : * for j in range(k, 0, -1):
12515 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
12516 : *
12517 : * # W is the block of rows to be removed from q, has shape, (p,m)
12518 : */
12519 419 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, ((__pyx_v_j + __pyx_v_p) - 1)), (__pyx_v_qs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
12520 : }
12521 :
12522 : /* "scipy/linalg/_decomp_update.pyx":460
12523 : * cdef int* ws
12524 : *
12525 : * if k != 0: # <<<<<<<<<<<<<<
12526 : * for j in range(k, 0, -1):
12527 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12528 : */
12529 : }
12530 :
12531 : /* "scipy/linalg/_decomp_update.pyx":465
12532 : *
12533 : * # W is the block of rows to be removed from q, has shape, (p,m)
12534 : * W = q # <<<<<<<<<<<<<<
12535 : * ws = qs
12536 : *
12537 : */
12538 : __pyx_v_W = __pyx_v_q;
12539 :
12540 : /* "scipy/linalg/_decomp_update.pyx":466
12541 : * # W is the block of rows to be removed from q, has shape, (p,m)
12542 : * W = q
12543 : * ws = qs # <<<<<<<<<<<<<<
12544 : *
12545 : * for j in range(p):
12546 : */
12547 : __pyx_v_ws = __pyx_v_qs;
12548 :
12549 : /* "scipy/linalg/_decomp_update.pyx":468
12550 : * ws = qs
12551 : *
12552 : * for j in range(p): # <<<<<<<<<<<<<<
12553 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12554 : *
12555 : */
12556 288 : __pyx_t_2 = __pyx_v_p;
12557 : __pyx_t_3 = __pyx_t_2;
12558 288 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12559 : __pyx_v_j = __pyx_t_4;
12560 :
12561 : /* "scipy/linalg/_decomp_update.pyx":469
12562 : *
12563 : * for j in range(p):
12564 : * blas_t_conj(m, row(W, ws, j), &ws[1]) # <<<<<<<<<<<<<<
12565 : *
12566 : * for i in range(p):
12567 : */
12568 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_W, __pyx_v_ws, __pyx_v_j), (&(__pyx_v_ws[1])));
12569 : }
12570 :
12571 : /* "scipy/linalg/_decomp_update.pyx":471
12572 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12573 : *
12574 : * for i in range(p): # <<<<<<<<<<<<<<
12575 : * for j in range(m-2, i-1, -1):
12576 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12577 : */
12578 948 : __pyx_t_2 = __pyx_v_p;
12579 : __pyx_t_3 = __pyx_t_2;
12580 948 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12581 660 : __pyx_v_i = __pyx_t_4;
12582 :
12583 : /* "scipy/linalg/_decomp_update.pyx":472
12584 : *
12585 : * for i in range(p):
12586 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
12587 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12588 : *
12589 : */
12590 660 : __pyx_t_5 = (__pyx_v_i - 1);
12591 660 : __pyx_t_6 = __pyx_t_5;
12592 5346 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
12593 4686 : __pyx_v_j = __pyx_t_7;
12594 :
12595 : /* "scipy/linalg/_decomp_update.pyx":473
12596 : * for i in range(p):
12597 : * for j in range(m-2, i-1, -1):
12598 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s) # <<<<<<<<<<<<<<
12599 : *
12600 : * # update W
12601 : */
12602 4686 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
12603 :
12604 : /* "scipy/linalg/_decomp_update.pyx":476
12605 : *
12606 : * # update W
12607 : * if i+1 < p: # <<<<<<<<<<<<<<
12608 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
12609 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12610 : */
12611 4686 : __pyx_t_1 = ((__pyx_v_i + 1) < __pyx_v_p);
12612 4686 : if (__pyx_t_1) {
12613 :
12614 : /* "scipy/linalg/_decomp_update.pyx":477
12615 : * # update W
12616 : * if i+1 < p:
12617 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0], # <<<<<<<<<<<<<<
12618 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12619 : *
12620 : */
12621 2751 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), __pyx_v_j), (__pyx_v_ws[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), (__pyx_v_j + 1)), (__pyx_v_ws[0]), __pyx_v_c, __pyx_v_s);
12622 :
12623 : /* "scipy/linalg/_decomp_update.pyx":476
12624 : *
12625 : * # update W
12626 : * if i+1 < p: # <<<<<<<<<<<<<<
12627 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
12628 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12629 : */
12630 : }
12631 :
12632 : /* "scipy/linalg/_decomp_update.pyx":481
12633 : *
12634 : * # update r if there is a nonzero row.
12635 : * if j-i < n: # <<<<<<<<<<<<<<
12636 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
12637 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12638 : */
12639 4686 : __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < __pyx_v_n);
12640 4686 : if (__pyx_t_1) {
12641 :
12642 : /* "scipy/linalg/_decomp_update.pyx":482
12643 : * # update r if there is a nonzero row.
12644 : * if j-i < n:
12645 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1], # <<<<<<<<<<<<<<
12646 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12647 : *
12648 : */
12649 3694 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) + __pyx_v_i), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
12650 :
12651 : /* "scipy/linalg/_decomp_update.pyx":481
12652 : *
12653 : * # update r if there is a nonzero row.
12654 : * if j-i < n: # <<<<<<<<<<<<<<
12655 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
12656 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12657 : */
12658 : }
12659 :
12660 : /* "scipy/linalg/_decomp_update.pyx":486
12661 : *
12662 : * # update q
12663 : * rot(m-p, index2(q, qs, p, j), qs[0], index2(q, qs, p, j+1), qs[0], # <<<<<<<<<<<<<<
12664 : * c, s.conjugate())
12665 : *
12666 : */
12667 4686 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - __pyx_v_p), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
12668 : }
12669 : }
12670 :
12671 : /* "scipy/linalg/_decomp_update.pyx":453
12672 : * return 1
12673 : *
12674 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
12675 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
12676 : * cdef int i, j
12677 : */
12678 :
12679 : /* function exit code */
12680 288 : }
12681 :
12682 288 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
12683 288 : int __pyx_v_i;
12684 288 : int __pyx_v_j;
12685 288 : __pyx_t_float_complex __pyx_v_c;
12686 288 : __pyx_t_float_complex __pyx_v_s;
12687 288 : __pyx_t_float_complex *__pyx_v_W;
12688 288 : int *__pyx_v_ws;
12689 288 : int __pyx_t_1;
12690 288 : int __pyx_t_2;
12691 288 : int __pyx_t_3;
12692 288 : int __pyx_t_4;
12693 288 : long __pyx_t_5;
12694 288 : long __pyx_t_6;
12695 288 : int __pyx_t_7;
12696 :
12697 : /* "scipy/linalg/_decomp_update.pyx":460
12698 : * cdef int* ws
12699 : *
12700 : * if k != 0: # <<<<<<<<<<<<<<
12701 : * for j in range(k, 0, -1):
12702 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12703 : */
12704 288 : __pyx_t_1 = (__pyx_v_k != 0);
12705 288 : if (__pyx_t_1) {
12706 :
12707 : /* "scipy/linalg/_decomp_update.pyx":461
12708 : *
12709 : * if k != 0:
12710 : * for j in range(k, 0, -1): # <<<<<<<<<<<<<<
12711 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12712 : *
12713 : */
12714 538 : for (__pyx_t_2 = __pyx_v_k; __pyx_t_2 > 0; __pyx_t_2-=1) {
12715 419 : __pyx_v_j = __pyx_t_2;
12716 :
12717 : /* "scipy/linalg/_decomp_update.pyx":462
12718 : * if k != 0:
12719 : * for j in range(k, 0, -1):
12720 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
12721 : *
12722 : * # W is the block of rows to be removed from q, has shape, (p,m)
12723 : */
12724 419 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, ((__pyx_v_j + __pyx_v_p) - 1)), (__pyx_v_qs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
12725 : }
12726 :
12727 : /* "scipy/linalg/_decomp_update.pyx":460
12728 : * cdef int* ws
12729 : *
12730 : * if k != 0: # <<<<<<<<<<<<<<
12731 : * for j in range(k, 0, -1):
12732 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12733 : */
12734 : }
12735 :
12736 : /* "scipy/linalg/_decomp_update.pyx":465
12737 : *
12738 : * # W is the block of rows to be removed from q, has shape, (p,m)
12739 : * W = q # <<<<<<<<<<<<<<
12740 : * ws = qs
12741 : *
12742 : */
12743 : __pyx_v_W = __pyx_v_q;
12744 :
12745 : /* "scipy/linalg/_decomp_update.pyx":466
12746 : * # W is the block of rows to be removed from q, has shape, (p,m)
12747 : * W = q
12748 : * ws = qs # <<<<<<<<<<<<<<
12749 : *
12750 : * for j in range(p):
12751 : */
12752 : __pyx_v_ws = __pyx_v_qs;
12753 :
12754 : /* "scipy/linalg/_decomp_update.pyx":468
12755 : * ws = qs
12756 : *
12757 : * for j in range(p): # <<<<<<<<<<<<<<
12758 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12759 : *
12760 : */
12761 948 : __pyx_t_2 = __pyx_v_p;
12762 : __pyx_t_3 = __pyx_t_2;
12763 948 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12764 660 : __pyx_v_j = __pyx_t_4;
12765 :
12766 : /* "scipy/linalg/_decomp_update.pyx":469
12767 : *
12768 : * for j in range(p):
12769 : * blas_t_conj(m, row(W, ws, j), &ws[1]) # <<<<<<<<<<<<<<
12770 : *
12771 : * for i in range(p):
12772 : */
12773 660 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_W, __pyx_v_ws, __pyx_v_j), (&(__pyx_v_ws[1])));
12774 : }
12775 :
12776 : /* "scipy/linalg/_decomp_update.pyx":471
12777 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12778 : *
12779 : * for i in range(p): # <<<<<<<<<<<<<<
12780 : * for j in range(m-2, i-1, -1):
12781 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12782 : */
12783 948 : __pyx_t_2 = __pyx_v_p;
12784 : __pyx_t_3 = __pyx_t_2;
12785 948 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12786 660 : __pyx_v_i = __pyx_t_4;
12787 :
12788 : /* "scipy/linalg/_decomp_update.pyx":472
12789 : *
12790 : * for i in range(p):
12791 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
12792 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12793 : *
12794 : */
12795 660 : __pyx_t_5 = (__pyx_v_i - 1);
12796 660 : __pyx_t_6 = __pyx_t_5;
12797 5346 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
12798 4686 : __pyx_v_j = __pyx_t_7;
12799 :
12800 : /* "scipy/linalg/_decomp_update.pyx":473
12801 : * for i in range(p):
12802 : * for j in range(m-2, i-1, -1):
12803 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s) # <<<<<<<<<<<<<<
12804 : *
12805 : * # update W
12806 : */
12807 4686 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
12808 :
12809 : /* "scipy/linalg/_decomp_update.pyx":476
12810 : *
12811 : * # update W
12812 : * if i+1 < p: # <<<<<<<<<<<<<<
12813 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
12814 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12815 : */
12816 4686 : __pyx_t_1 = ((__pyx_v_i + 1) < __pyx_v_p);
12817 4686 : if (__pyx_t_1) {
12818 :
12819 : /* "scipy/linalg/_decomp_update.pyx":477
12820 : * # update W
12821 : * if i+1 < p:
12822 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0], # <<<<<<<<<<<<<<
12823 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12824 : *
12825 : */
12826 2751 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), __pyx_v_j), (__pyx_v_ws[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), (__pyx_v_j + 1)), (__pyx_v_ws[0]), __pyx_v_c, __pyx_v_s);
12827 :
12828 : /* "scipy/linalg/_decomp_update.pyx":476
12829 : *
12830 : * # update W
12831 : * if i+1 < p: # <<<<<<<<<<<<<<
12832 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
12833 : * index2(W, ws, i+1, j+1), ws[0], c, s)
12834 : */
12835 : }
12836 :
12837 : /* "scipy/linalg/_decomp_update.pyx":481
12838 : *
12839 : * # update r if there is a nonzero row.
12840 : * if j-i < n: # <<<<<<<<<<<<<<
12841 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
12842 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12843 : */
12844 4686 : __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < __pyx_v_n);
12845 4686 : if (__pyx_t_1) {
12846 :
12847 : /* "scipy/linalg/_decomp_update.pyx":482
12848 : * # update r if there is a nonzero row.
12849 : * if j-i < n:
12850 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1], # <<<<<<<<<<<<<<
12851 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12852 : *
12853 : */
12854 3694 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) + __pyx_v_i), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
12855 :
12856 : /* "scipy/linalg/_decomp_update.pyx":481
12857 : *
12858 : * # update r if there is a nonzero row.
12859 : * if j-i < n: # <<<<<<<<<<<<<<
12860 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
12861 : * index2(r, rs, j+1, j-i), rs[1], c, s)
12862 : */
12863 : }
12864 :
12865 : /* "scipy/linalg/_decomp_update.pyx":486
12866 : *
12867 : * # update q
12868 : * rot(m-p, index2(q, qs, p, j), qs[0], index2(q, qs, p, j+1), qs[0], # <<<<<<<<<<<<<<
12869 : * c, s.conjugate())
12870 : *
12871 : */
12872 4686 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - __pyx_v_p), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
12873 : }
12874 : }
12875 :
12876 : /* "scipy/linalg/_decomp_update.pyx":453
12877 : * return 1
12878 : *
12879 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
12880 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
12881 : * cdef int i, j
12882 : */
12883 :
12884 : /* function exit code */
12885 288 : }
12886 :
12887 288 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
12888 288 : int __pyx_v_i;
12889 288 : int __pyx_v_j;
12890 288 : __pyx_t_double_complex __pyx_v_c;
12891 288 : __pyx_t_double_complex __pyx_v_s;
12892 288 : __pyx_t_double_complex *__pyx_v_W;
12893 288 : int *__pyx_v_ws;
12894 288 : int __pyx_t_1;
12895 288 : int __pyx_t_2;
12896 288 : int __pyx_t_3;
12897 288 : int __pyx_t_4;
12898 288 : long __pyx_t_5;
12899 288 : long __pyx_t_6;
12900 288 : int __pyx_t_7;
12901 :
12902 : /* "scipy/linalg/_decomp_update.pyx":460
12903 : * cdef int* ws
12904 : *
12905 : * if k != 0: # <<<<<<<<<<<<<<
12906 : * for j in range(k, 0, -1):
12907 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12908 : */
12909 288 : __pyx_t_1 = (__pyx_v_k != 0);
12910 288 : if (__pyx_t_1) {
12911 :
12912 : /* "scipy/linalg/_decomp_update.pyx":461
12913 : *
12914 : * if k != 0:
12915 : * for j in range(k, 0, -1): # <<<<<<<<<<<<<<
12916 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12917 : *
12918 : */
12919 538 : for (__pyx_t_2 = __pyx_v_k; __pyx_t_2 > 0; __pyx_t_2-=1) {
12920 419 : __pyx_v_j = __pyx_t_2;
12921 :
12922 : /* "scipy/linalg/_decomp_update.pyx":462
12923 : * if k != 0:
12924 : * for j in range(k, 0, -1):
12925 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
12926 : *
12927 : * # W is the block of rows to be removed from q, has shape, (p,m)
12928 : */
12929 419 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, ((__pyx_v_j + __pyx_v_p) - 1)), (__pyx_v_qs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
12930 : }
12931 :
12932 : /* "scipy/linalg/_decomp_update.pyx":460
12933 : * cdef int* ws
12934 : *
12935 : * if k != 0: # <<<<<<<<<<<<<<
12936 : * for j in range(k, 0, -1):
12937 : * swap(m, row(q, qs, j+p-1), qs[1], row(q, qs, j-1), qs[1])
12938 : */
12939 : }
12940 :
12941 : /* "scipy/linalg/_decomp_update.pyx":465
12942 : *
12943 : * # W is the block of rows to be removed from q, has shape, (p,m)
12944 : * W = q # <<<<<<<<<<<<<<
12945 : * ws = qs
12946 : *
12947 : */
12948 : __pyx_v_W = __pyx_v_q;
12949 :
12950 : /* "scipy/linalg/_decomp_update.pyx":466
12951 : * # W is the block of rows to be removed from q, has shape, (p,m)
12952 : * W = q
12953 : * ws = qs # <<<<<<<<<<<<<<
12954 : *
12955 : * for j in range(p):
12956 : */
12957 : __pyx_v_ws = __pyx_v_qs;
12958 :
12959 : /* "scipy/linalg/_decomp_update.pyx":468
12960 : * ws = qs
12961 : *
12962 : * for j in range(p): # <<<<<<<<<<<<<<
12963 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12964 : *
12965 : */
12966 948 : __pyx_t_2 = __pyx_v_p;
12967 : __pyx_t_3 = __pyx_t_2;
12968 948 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12969 660 : __pyx_v_j = __pyx_t_4;
12970 :
12971 : /* "scipy/linalg/_decomp_update.pyx":469
12972 : *
12973 : * for j in range(p):
12974 : * blas_t_conj(m, row(W, ws, j), &ws[1]) # <<<<<<<<<<<<<<
12975 : *
12976 : * for i in range(p):
12977 : */
12978 660 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_W, __pyx_v_ws, __pyx_v_j), (&(__pyx_v_ws[1])));
12979 : }
12980 :
12981 : /* "scipy/linalg/_decomp_update.pyx":471
12982 : * blas_t_conj(m, row(W, ws, j), &ws[1])
12983 : *
12984 : * for i in range(p): # <<<<<<<<<<<<<<
12985 : * for j in range(m-2, i-1, -1):
12986 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12987 : */
12988 948 : __pyx_t_2 = __pyx_v_p;
12989 : __pyx_t_3 = __pyx_t_2;
12990 948 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
12991 660 : __pyx_v_i = __pyx_t_4;
12992 :
12993 : /* "scipy/linalg/_decomp_update.pyx":472
12994 : *
12995 : * for i in range(p):
12996 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
12997 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s)
12998 : *
12999 : */
13000 660 : __pyx_t_5 = (__pyx_v_i - 1);
13001 660 : __pyx_t_6 = __pyx_t_5;
13002 5346 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
13003 4686 : __pyx_v_j = __pyx_t_7;
13004 :
13005 : /* "scipy/linalg/_decomp_update.pyx":473
13006 : * for i in range(p):
13007 : * for j in range(m-2, i-1, -1):
13008 : * lartg(index2(W, ws, i, j), index2(W, ws, i, j+1), &c, &s) # <<<<<<<<<<<<<<
13009 : *
13010 : * # update W
13011 : */
13012 4686 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, __pyx_v_i, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
13013 :
13014 : /* "scipy/linalg/_decomp_update.pyx":476
13015 : *
13016 : * # update W
13017 : * if i+1 < p: # <<<<<<<<<<<<<<
13018 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
13019 : * index2(W, ws, i+1, j+1), ws[0], c, s)
13020 : */
13021 4686 : __pyx_t_1 = ((__pyx_v_i + 1) < __pyx_v_p);
13022 4686 : if (__pyx_t_1) {
13023 :
13024 : /* "scipy/linalg/_decomp_update.pyx":477
13025 : * # update W
13026 : * if i+1 < p:
13027 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0], # <<<<<<<<<<<<<<
13028 : * index2(W, ws, i+1, j+1), ws[0], c, s)
13029 : *
13030 : */
13031 2751 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), __pyx_v_j), (__pyx_v_ws[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_W, __pyx_v_ws, (__pyx_v_i + 1), (__pyx_v_j + 1)), (__pyx_v_ws[0]), __pyx_v_c, __pyx_v_s);
13032 :
13033 : /* "scipy/linalg/_decomp_update.pyx":476
13034 : *
13035 : * # update W
13036 : * if i+1 < p: # <<<<<<<<<<<<<<
13037 : * rot(p-i-1, index2(W, ws, i+1, j), ws[0],
13038 : * index2(W, ws, i+1, j+1), ws[0], c, s)
13039 : */
13040 : }
13041 :
13042 : /* "scipy/linalg/_decomp_update.pyx":481
13043 : *
13044 : * # update r if there is a nonzero row.
13045 : * if j-i < n: # <<<<<<<<<<<<<<
13046 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
13047 : * index2(r, rs, j+1, j-i), rs[1], c, s)
13048 : */
13049 4686 : __pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < __pyx_v_n);
13050 4686 : if (__pyx_t_1) {
13051 :
13052 : /* "scipy/linalg/_decomp_update.pyx":482
13053 : * # update r if there is a nonzero row.
13054 : * if j-i < n:
13055 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1], # <<<<<<<<<<<<<<
13056 : * index2(r, rs, j+1, j-i), rs[1], c, s)
13057 : *
13058 : */
13059 3694 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) + __pyx_v_i), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j - __pyx_v_i)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
13060 :
13061 : /* "scipy/linalg/_decomp_update.pyx":481
13062 : *
13063 : * # update r if there is a nonzero row.
13064 : * if j-i < n: # <<<<<<<<<<<<<<
13065 : * rot(n-j+i, index2(r, rs, j, j-i), rs[1],
13066 : * index2(r, rs, j+1, j-i), rs[1], c, s)
13067 : */
13068 : }
13069 :
13070 : /* "scipy/linalg/_decomp_update.pyx":486
13071 : *
13072 : * # update q
13073 : * rot(m-p, index2(q, qs, p, j), qs[0], index2(q, qs, p, j+1), qs[0], # <<<<<<<<<<<<<<
13074 : * c, s.conjugate())
13075 : *
13076 : */
13077 4686 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_m - __pyx_v_p), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_p, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
13078 : }
13079 : }
13080 :
13081 : /* "scipy/linalg/_decomp_update.pyx":453
13082 : * return 1
13083 : *
13084 : * cdef void qr_block_row_delete(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
13085 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
13086 : * cdef int i, j
13087 : */
13088 :
13089 : /* function exit code */
13090 288 : }
13091 :
13092 : /* "scipy/linalg/_decomp_update.pyx":489
13093 : * c, s.conjugate())
13094 : *
13095 : * cdef void qr_col_delete(int m, int o, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
13096 : * int* rs, int k) noexcept nogil:
13097 : * """
13098 : */
13099 :
13100 122 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
13101 122 : int __pyx_v_j;
13102 122 : int __pyx_v_limit;
13103 122 : int __pyx_t_1;
13104 122 : int __pyx_t_2;
13105 122 : int __pyx_t_3;
13106 122 : int __pyx_t_4;
13107 122 : long __pyx_t_5;
13108 122 : long __pyx_t_6;
13109 :
13110 : /* "scipy/linalg/_decomp_update.pyx":496
13111 : * """
13112 : * cdef int j
13113 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13114 : *
13115 : * for j in range(k, n-1):
13116 : */
13117 122 : __pyx_t_1 = __pyx_v_n;
13118 122 : __pyx_t_2 = __pyx_v_o;
13119 122 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13120 122 : if (__pyx_t_4) {
13121 : __pyx_t_3 = __pyx_t_1;
13122 : } else {
13123 : __pyx_t_3 = __pyx_t_2;
13124 : }
13125 122 : __pyx_v_limit = __pyx_t_3;
13126 :
13127 : /* "scipy/linalg/_decomp_update.pyx":498
13128 : * cdef int limit = min(o, n)
13129 : *
13130 : * for j in range(k, n-1): # <<<<<<<<<<<<<<
13131 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13132 : *
13133 : */
13134 122 : __pyx_t_5 = (__pyx_v_n - 1);
13135 122 : __pyx_t_6 = __pyx_t_5;
13136 882 : for (__pyx_t_3 = __pyx_v_k; __pyx_t_3 < __pyx_t_6; __pyx_t_3+=1) {
13137 760 : __pyx_v_j = __pyx_t_3;
13138 :
13139 : /* "scipy/linalg/_decomp_update.pyx":499
13140 : *
13141 : * for j in range(k, n-1):
13142 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13143 : *
13144 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13145 : */
13146 760 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13147 : }
13148 :
13149 : /* "scipy/linalg/_decomp_update.pyx":501
13150 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13151 : *
13152 : * hessenberg_qr(m, n-1, q, qs, r, rs, k) # <<<<<<<<<<<<<<
13153 : *
13154 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs,
13155 : */
13156 122 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, (__pyx_v_n - 1), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k);
13157 :
13158 : /* "scipy/linalg/_decomp_update.pyx":489
13159 : * c, s.conjugate())
13160 : *
13161 : * cdef void qr_col_delete(int m, int o, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
13162 : * int* rs, int k) noexcept nogil:
13163 : * """
13164 : */
13165 :
13166 : /* function exit code */
13167 122 : }
13168 :
13169 122 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
13170 122 : int __pyx_v_j;
13171 122 : int __pyx_v_limit;
13172 122 : int __pyx_t_1;
13173 122 : int __pyx_t_2;
13174 122 : int __pyx_t_3;
13175 122 : int __pyx_t_4;
13176 122 : long __pyx_t_5;
13177 122 : long __pyx_t_6;
13178 :
13179 : /* "scipy/linalg/_decomp_update.pyx":496
13180 : * """
13181 : * cdef int j
13182 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13183 : *
13184 : * for j in range(k, n-1):
13185 : */
13186 122 : __pyx_t_1 = __pyx_v_n;
13187 122 : __pyx_t_2 = __pyx_v_o;
13188 122 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13189 122 : if (__pyx_t_4) {
13190 : __pyx_t_3 = __pyx_t_1;
13191 : } else {
13192 : __pyx_t_3 = __pyx_t_2;
13193 : }
13194 122 : __pyx_v_limit = __pyx_t_3;
13195 :
13196 : /* "scipy/linalg/_decomp_update.pyx":498
13197 : * cdef int limit = min(o, n)
13198 : *
13199 : * for j in range(k, n-1): # <<<<<<<<<<<<<<
13200 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13201 : *
13202 : */
13203 122 : __pyx_t_5 = (__pyx_v_n - 1);
13204 122 : __pyx_t_6 = __pyx_t_5;
13205 882 : for (__pyx_t_3 = __pyx_v_k; __pyx_t_3 < __pyx_t_6; __pyx_t_3+=1) {
13206 760 : __pyx_v_j = __pyx_t_3;
13207 :
13208 : /* "scipy/linalg/_decomp_update.pyx":499
13209 : *
13210 : * for j in range(k, n-1):
13211 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13212 : *
13213 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13214 : */
13215 760 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13216 : }
13217 :
13218 : /* "scipy/linalg/_decomp_update.pyx":501
13219 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13220 : *
13221 : * hessenberg_qr(m, n-1, q, qs, r, rs, k) # <<<<<<<<<<<<<<
13222 : *
13223 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs,
13224 : */
13225 122 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, (__pyx_v_n - 1), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k);
13226 :
13227 : /* "scipy/linalg/_decomp_update.pyx":489
13228 : * c, s.conjugate())
13229 : *
13230 : * cdef void qr_col_delete(int m, int o, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
13231 : * int* rs, int k) noexcept nogil:
13232 : * """
13233 : */
13234 :
13235 : /* function exit code */
13236 122 : }
13237 :
13238 122 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
13239 122 : int __pyx_v_j;
13240 122 : int __pyx_v_limit;
13241 122 : int __pyx_t_1;
13242 122 : int __pyx_t_2;
13243 122 : int __pyx_t_3;
13244 122 : int __pyx_t_4;
13245 122 : long __pyx_t_5;
13246 122 : long __pyx_t_6;
13247 :
13248 : /* "scipy/linalg/_decomp_update.pyx":496
13249 : * """
13250 : * cdef int j
13251 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13252 : *
13253 : * for j in range(k, n-1):
13254 : */
13255 122 : __pyx_t_1 = __pyx_v_n;
13256 122 : __pyx_t_2 = __pyx_v_o;
13257 122 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13258 122 : if (__pyx_t_4) {
13259 : __pyx_t_3 = __pyx_t_1;
13260 : } else {
13261 : __pyx_t_3 = __pyx_t_2;
13262 : }
13263 122 : __pyx_v_limit = __pyx_t_3;
13264 :
13265 : /* "scipy/linalg/_decomp_update.pyx":498
13266 : * cdef int limit = min(o, n)
13267 : *
13268 : * for j in range(k, n-1): # <<<<<<<<<<<<<<
13269 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13270 : *
13271 : */
13272 122 : __pyx_t_5 = (__pyx_v_n - 1);
13273 122 : __pyx_t_6 = __pyx_t_5;
13274 882 : for (__pyx_t_3 = __pyx_v_k; __pyx_t_3 < __pyx_t_6; __pyx_t_3+=1) {
13275 760 : __pyx_v_j = __pyx_t_3;
13276 :
13277 : /* "scipy/linalg/_decomp_update.pyx":499
13278 : *
13279 : * for j in range(k, n-1):
13280 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13281 : *
13282 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13283 : */
13284 760 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13285 : }
13286 :
13287 : /* "scipy/linalg/_decomp_update.pyx":501
13288 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13289 : *
13290 : * hessenberg_qr(m, n-1, q, qs, r, rs, k) # <<<<<<<<<<<<<<
13291 : *
13292 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs,
13293 : */
13294 122 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, (__pyx_v_n - 1), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k);
13295 :
13296 : /* "scipy/linalg/_decomp_update.pyx":489
13297 : * c, s.conjugate())
13298 : *
13299 : * cdef void qr_col_delete(int m, int o, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
13300 : * int* rs, int k) noexcept nogil:
13301 : * """
13302 : */
13303 :
13304 : /* function exit code */
13305 122 : }
13306 :
13307 122 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
13308 122 : int __pyx_v_j;
13309 122 : int __pyx_v_limit;
13310 122 : int __pyx_t_1;
13311 122 : int __pyx_t_2;
13312 122 : int __pyx_t_3;
13313 122 : int __pyx_t_4;
13314 122 : long __pyx_t_5;
13315 122 : long __pyx_t_6;
13316 :
13317 : /* "scipy/linalg/_decomp_update.pyx":496
13318 : * """
13319 : * cdef int j
13320 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13321 : *
13322 : * for j in range(k, n-1):
13323 : */
13324 122 : __pyx_t_1 = __pyx_v_n;
13325 122 : __pyx_t_2 = __pyx_v_o;
13326 122 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13327 122 : if (__pyx_t_4) {
13328 : __pyx_t_3 = __pyx_t_1;
13329 : } else {
13330 : __pyx_t_3 = __pyx_t_2;
13331 : }
13332 122 : __pyx_v_limit = __pyx_t_3;
13333 :
13334 : /* "scipy/linalg/_decomp_update.pyx":498
13335 : * cdef int limit = min(o, n)
13336 : *
13337 : * for j in range(k, n-1): # <<<<<<<<<<<<<<
13338 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13339 : *
13340 : */
13341 122 : __pyx_t_5 = (__pyx_v_n - 1);
13342 122 : __pyx_t_6 = __pyx_t_5;
13343 882 : for (__pyx_t_3 = __pyx_v_k; __pyx_t_3 < __pyx_t_6; __pyx_t_3+=1) {
13344 760 : __pyx_v_j = __pyx_t_3;
13345 :
13346 : /* "scipy/linalg/_decomp_update.pyx":499
13347 : *
13348 : * for j in range(k, n-1):
13349 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13350 : *
13351 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13352 : */
13353 760 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13354 : }
13355 :
13356 : /* "scipy/linalg/_decomp_update.pyx":501
13357 : * copy(limit, col(r, rs, j+1), rs[0], col(r, rs, j), rs[0])
13358 : *
13359 : * hessenberg_qr(m, n-1, q, qs, r, rs, k) # <<<<<<<<<<<<<<
13360 : *
13361 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs,
13362 : */
13363 122 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, (__pyx_v_n - 1), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k);
13364 :
13365 : /* "scipy/linalg/_decomp_update.pyx":489
13366 : * c, s.conjugate())
13367 : *
13368 : * cdef void qr_col_delete(int m, int o, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
13369 : * int* rs, int k) noexcept nogil:
13370 : * """
13371 : */
13372 :
13373 : /* function exit code */
13374 122 : }
13375 :
13376 : /* "scipy/linalg/_decomp_update.pyx":503
13377 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13378 : *
13379 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
13380 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
13381 : * """
13382 : */
13383 :
13384 176 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
13385 176 : int __pyx_v_j;
13386 176 : int __pyx_v_limit;
13387 176 : float *__pyx_v_work;
13388 176 : int __pyx_v_worksize;
13389 176 : int __pyx_r;
13390 176 : int __pyx_t_1;
13391 176 : int __pyx_t_2;
13392 176 : int __pyx_t_3;
13393 176 : int __pyx_t_4;
13394 :
13395 : /* "scipy/linalg/_decomp_update.pyx":510
13396 : * """
13397 : * cdef int j
13398 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13399 : * cdef blas_t* work
13400 : * cdef int worksize = max(m, n)
13401 : */
13402 176 : __pyx_t_1 = __pyx_v_n;
13403 176 : __pyx_t_2 = __pyx_v_o;
13404 176 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13405 176 : if (__pyx_t_4) {
13406 : __pyx_t_3 = __pyx_t_1;
13407 : } else {
13408 : __pyx_t_3 = __pyx_t_2;
13409 : }
13410 176 : __pyx_v_limit = __pyx_t_3;
13411 :
13412 : /* "scipy/linalg/_decomp_update.pyx":512
13413 : * cdef int limit = min(o, n)
13414 : * cdef blas_t* work
13415 : * cdef int worksize = max(m, n) # <<<<<<<<<<<<<<
13416 : *
13417 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13418 : */
13419 176 : __pyx_t_3 = __pyx_v_n;
13420 176 : __pyx_t_1 = __pyx_v_m;
13421 176 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
13422 176 : if (__pyx_t_4) {
13423 : __pyx_t_2 = __pyx_t_3;
13424 : } else {
13425 : __pyx_t_2 = __pyx_t_1;
13426 : }
13427 176 : __pyx_v_worksize = __pyx_t_2;
13428 :
13429 : /* "scipy/linalg/_decomp_update.pyx":514
13430 : * cdef int worksize = max(m, n)
13431 : *
13432 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t)) # <<<<<<<<<<<<<<
13433 : * if not work:
13434 : * return MEMORY_ERROR
13435 : */
13436 176 : __pyx_v_work = ((float *)malloc((__pyx_v_worksize * (sizeof(float)))));
13437 :
13438 : /* "scipy/linalg/_decomp_update.pyx":515
13439 : *
13440 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13441 : * if not work: # <<<<<<<<<<<<<<
13442 : * return MEMORY_ERROR
13443 : *
13444 : */
13445 176 : __pyx_t_4 = (!(__pyx_v_work != 0));
13446 176 : if (__pyx_t_4) {
13447 :
13448 : /* "scipy/linalg/_decomp_update.pyx":516
13449 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13450 : * if not work:
13451 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
13452 : *
13453 : * # move the columns to removed to the end
13454 : */
13455 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
13456 0 : goto __pyx_L0;
13457 :
13458 : /* "scipy/linalg/_decomp_update.pyx":515
13459 : *
13460 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13461 : * if not work: # <<<<<<<<<<<<<<
13462 : * return MEMORY_ERROR
13463 : *
13464 : */
13465 : }
13466 :
13467 : /* "scipy/linalg/_decomp_update.pyx":519
13468 : *
13469 : * # move the columns to removed to the end
13470 : * for j in range(k, n-p): # <<<<<<<<<<<<<<
13471 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13472 : *
13473 : */
13474 176 : __pyx_t_2 = (__pyx_v_n - __pyx_v_p);
13475 176 : __pyx_t_3 = __pyx_t_2;
13476 952 : for (__pyx_t_1 = __pyx_v_k; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
13477 776 : __pyx_v_j = __pyx_t_1;
13478 :
13479 : /* "scipy/linalg/_decomp_update.pyx":520
13480 : * # move the columns to removed to the end
13481 : * for j in range(k, n-p):
13482 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13483 : *
13484 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13485 : */
13486 776 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + __pyx_v_p)), (__pyx_v_rs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13487 : }
13488 :
13489 : /* "scipy/linalg/_decomp_update.pyx":522
13490 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13491 : *
13492 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work) # <<<<<<<<<<<<<<
13493 : *
13494 : * libc.stdlib.free(work)
13495 : */
13496 176 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_o, (__pyx_v_n - __pyx_v_p), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p, __pyx_v_work);
13497 :
13498 : /* "scipy/linalg/_decomp_update.pyx":524
13499 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13500 : *
13501 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
13502 : * return 0
13503 : *
13504 : */
13505 176 : free(__pyx_v_work);
13506 :
13507 : /* "scipy/linalg/_decomp_update.pyx":525
13508 : *
13509 : * libc.stdlib.free(work)
13510 : * return 0 # <<<<<<<<<<<<<<
13511 : *
13512 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
13513 : */
13514 176 : __pyx_r = 0;
13515 176 : goto __pyx_L0;
13516 :
13517 : /* "scipy/linalg/_decomp_update.pyx":503
13518 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13519 : *
13520 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
13521 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
13522 : * """
13523 : */
13524 :
13525 : /* function exit code */
13526 176 : __pyx_L0:;
13527 176 : return __pyx_r;
13528 : }
13529 :
13530 176 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
13531 176 : int __pyx_v_j;
13532 176 : int __pyx_v_limit;
13533 176 : double *__pyx_v_work;
13534 176 : int __pyx_v_worksize;
13535 176 : int __pyx_r;
13536 176 : int __pyx_t_1;
13537 176 : int __pyx_t_2;
13538 176 : int __pyx_t_3;
13539 176 : int __pyx_t_4;
13540 :
13541 : /* "scipy/linalg/_decomp_update.pyx":510
13542 : * """
13543 : * cdef int j
13544 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13545 : * cdef blas_t* work
13546 : * cdef int worksize = max(m, n)
13547 : */
13548 176 : __pyx_t_1 = __pyx_v_n;
13549 176 : __pyx_t_2 = __pyx_v_o;
13550 176 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13551 176 : if (__pyx_t_4) {
13552 : __pyx_t_3 = __pyx_t_1;
13553 : } else {
13554 : __pyx_t_3 = __pyx_t_2;
13555 : }
13556 176 : __pyx_v_limit = __pyx_t_3;
13557 :
13558 : /* "scipy/linalg/_decomp_update.pyx":512
13559 : * cdef int limit = min(o, n)
13560 : * cdef blas_t* work
13561 : * cdef int worksize = max(m, n) # <<<<<<<<<<<<<<
13562 : *
13563 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13564 : */
13565 176 : __pyx_t_3 = __pyx_v_n;
13566 176 : __pyx_t_1 = __pyx_v_m;
13567 176 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
13568 176 : if (__pyx_t_4) {
13569 : __pyx_t_2 = __pyx_t_3;
13570 : } else {
13571 : __pyx_t_2 = __pyx_t_1;
13572 : }
13573 176 : __pyx_v_worksize = __pyx_t_2;
13574 :
13575 : /* "scipy/linalg/_decomp_update.pyx":514
13576 : * cdef int worksize = max(m, n)
13577 : *
13578 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t)) # <<<<<<<<<<<<<<
13579 : * if not work:
13580 : * return MEMORY_ERROR
13581 : */
13582 176 : __pyx_v_work = ((double *)malloc((__pyx_v_worksize * (sizeof(double)))));
13583 :
13584 : /* "scipy/linalg/_decomp_update.pyx":515
13585 : *
13586 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13587 : * if not work: # <<<<<<<<<<<<<<
13588 : * return MEMORY_ERROR
13589 : *
13590 : */
13591 176 : __pyx_t_4 = (!(__pyx_v_work != 0));
13592 176 : if (__pyx_t_4) {
13593 :
13594 : /* "scipy/linalg/_decomp_update.pyx":516
13595 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13596 : * if not work:
13597 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
13598 : *
13599 : * # move the columns to removed to the end
13600 : */
13601 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
13602 0 : goto __pyx_L0;
13603 :
13604 : /* "scipy/linalg/_decomp_update.pyx":515
13605 : *
13606 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13607 : * if not work: # <<<<<<<<<<<<<<
13608 : * return MEMORY_ERROR
13609 : *
13610 : */
13611 : }
13612 :
13613 : /* "scipy/linalg/_decomp_update.pyx":519
13614 : *
13615 : * # move the columns to removed to the end
13616 : * for j in range(k, n-p): # <<<<<<<<<<<<<<
13617 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13618 : *
13619 : */
13620 176 : __pyx_t_2 = (__pyx_v_n - __pyx_v_p);
13621 176 : __pyx_t_3 = __pyx_t_2;
13622 952 : for (__pyx_t_1 = __pyx_v_k; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
13623 776 : __pyx_v_j = __pyx_t_1;
13624 :
13625 : /* "scipy/linalg/_decomp_update.pyx":520
13626 : * # move the columns to removed to the end
13627 : * for j in range(k, n-p):
13628 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13629 : *
13630 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13631 : */
13632 776 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + __pyx_v_p)), (__pyx_v_rs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13633 : }
13634 :
13635 : /* "scipy/linalg/_decomp_update.pyx":522
13636 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13637 : *
13638 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work) # <<<<<<<<<<<<<<
13639 : *
13640 : * libc.stdlib.free(work)
13641 : */
13642 176 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_o, (__pyx_v_n - __pyx_v_p), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p, __pyx_v_work);
13643 :
13644 : /* "scipy/linalg/_decomp_update.pyx":524
13645 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13646 : *
13647 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
13648 : * return 0
13649 : *
13650 : */
13651 176 : free(__pyx_v_work);
13652 :
13653 : /* "scipy/linalg/_decomp_update.pyx":525
13654 : *
13655 : * libc.stdlib.free(work)
13656 : * return 0 # <<<<<<<<<<<<<<
13657 : *
13658 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
13659 : */
13660 176 : __pyx_r = 0;
13661 176 : goto __pyx_L0;
13662 :
13663 : /* "scipy/linalg/_decomp_update.pyx":503
13664 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13665 : *
13666 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
13667 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
13668 : * """
13669 : */
13670 :
13671 : /* function exit code */
13672 176 : __pyx_L0:;
13673 176 : return __pyx_r;
13674 : }
13675 :
13676 176 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
13677 176 : int __pyx_v_j;
13678 176 : int __pyx_v_limit;
13679 176 : __pyx_t_float_complex *__pyx_v_work;
13680 176 : int __pyx_v_worksize;
13681 176 : int __pyx_r;
13682 176 : int __pyx_t_1;
13683 176 : int __pyx_t_2;
13684 176 : int __pyx_t_3;
13685 176 : int __pyx_t_4;
13686 :
13687 : /* "scipy/linalg/_decomp_update.pyx":510
13688 : * """
13689 : * cdef int j
13690 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13691 : * cdef blas_t* work
13692 : * cdef int worksize = max(m, n)
13693 : */
13694 176 : __pyx_t_1 = __pyx_v_n;
13695 176 : __pyx_t_2 = __pyx_v_o;
13696 176 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13697 176 : if (__pyx_t_4) {
13698 : __pyx_t_3 = __pyx_t_1;
13699 : } else {
13700 : __pyx_t_3 = __pyx_t_2;
13701 : }
13702 176 : __pyx_v_limit = __pyx_t_3;
13703 :
13704 : /* "scipy/linalg/_decomp_update.pyx":512
13705 : * cdef int limit = min(o, n)
13706 : * cdef blas_t* work
13707 : * cdef int worksize = max(m, n) # <<<<<<<<<<<<<<
13708 : *
13709 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13710 : */
13711 176 : __pyx_t_3 = __pyx_v_n;
13712 176 : __pyx_t_1 = __pyx_v_m;
13713 176 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
13714 176 : if (__pyx_t_4) {
13715 : __pyx_t_2 = __pyx_t_3;
13716 : } else {
13717 : __pyx_t_2 = __pyx_t_1;
13718 : }
13719 176 : __pyx_v_worksize = __pyx_t_2;
13720 :
13721 : /* "scipy/linalg/_decomp_update.pyx":514
13722 : * cdef int worksize = max(m, n)
13723 : *
13724 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t)) # <<<<<<<<<<<<<<
13725 : * if not work:
13726 : * return MEMORY_ERROR
13727 : */
13728 176 : __pyx_v_work = ((__pyx_t_float_complex *)malloc((__pyx_v_worksize * (sizeof(__pyx_t_float_complex)))));
13729 :
13730 : /* "scipy/linalg/_decomp_update.pyx":515
13731 : *
13732 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13733 : * if not work: # <<<<<<<<<<<<<<
13734 : * return MEMORY_ERROR
13735 : *
13736 : */
13737 176 : __pyx_t_4 = (!(__pyx_v_work != 0));
13738 176 : if (__pyx_t_4) {
13739 :
13740 : /* "scipy/linalg/_decomp_update.pyx":516
13741 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13742 : * if not work:
13743 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
13744 : *
13745 : * # move the columns to removed to the end
13746 : */
13747 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
13748 0 : goto __pyx_L0;
13749 :
13750 : /* "scipy/linalg/_decomp_update.pyx":515
13751 : *
13752 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13753 : * if not work: # <<<<<<<<<<<<<<
13754 : * return MEMORY_ERROR
13755 : *
13756 : */
13757 : }
13758 :
13759 : /* "scipy/linalg/_decomp_update.pyx":519
13760 : *
13761 : * # move the columns to removed to the end
13762 : * for j in range(k, n-p): # <<<<<<<<<<<<<<
13763 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13764 : *
13765 : */
13766 176 : __pyx_t_2 = (__pyx_v_n - __pyx_v_p);
13767 176 : __pyx_t_3 = __pyx_t_2;
13768 952 : for (__pyx_t_1 = __pyx_v_k; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
13769 776 : __pyx_v_j = __pyx_t_1;
13770 :
13771 : /* "scipy/linalg/_decomp_update.pyx":520
13772 : * # move the columns to removed to the end
13773 : * for j in range(k, n-p):
13774 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13775 : *
13776 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13777 : */
13778 776 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + __pyx_v_p)), (__pyx_v_rs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13779 : }
13780 :
13781 : /* "scipy/linalg/_decomp_update.pyx":522
13782 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13783 : *
13784 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work) # <<<<<<<<<<<<<<
13785 : *
13786 : * libc.stdlib.free(work)
13787 : */
13788 176 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_o, (__pyx_v_n - __pyx_v_p), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p, __pyx_v_work);
13789 :
13790 : /* "scipy/linalg/_decomp_update.pyx":524
13791 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13792 : *
13793 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
13794 : * return 0
13795 : *
13796 : */
13797 176 : free(__pyx_v_work);
13798 :
13799 : /* "scipy/linalg/_decomp_update.pyx":525
13800 : *
13801 : * libc.stdlib.free(work)
13802 : * return 0 # <<<<<<<<<<<<<<
13803 : *
13804 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
13805 : */
13806 176 : __pyx_r = 0;
13807 176 : goto __pyx_L0;
13808 :
13809 : /* "scipy/linalg/_decomp_update.pyx":503
13810 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13811 : *
13812 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
13813 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
13814 : * """
13815 : */
13816 :
13817 : /* function exit code */
13818 176 : __pyx_L0:;
13819 176 : return __pyx_r;
13820 : }
13821 :
13822 176 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
13823 176 : int __pyx_v_j;
13824 176 : int __pyx_v_limit;
13825 176 : __pyx_t_double_complex *__pyx_v_work;
13826 176 : int __pyx_v_worksize;
13827 176 : int __pyx_r;
13828 176 : int __pyx_t_1;
13829 176 : int __pyx_t_2;
13830 176 : int __pyx_t_3;
13831 176 : int __pyx_t_4;
13832 :
13833 : /* "scipy/linalg/_decomp_update.pyx":510
13834 : * """
13835 : * cdef int j
13836 : * cdef int limit = min(o, n) # <<<<<<<<<<<<<<
13837 : * cdef blas_t* work
13838 : * cdef int worksize = max(m, n)
13839 : */
13840 176 : __pyx_t_1 = __pyx_v_n;
13841 176 : __pyx_t_2 = __pyx_v_o;
13842 176 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
13843 176 : if (__pyx_t_4) {
13844 : __pyx_t_3 = __pyx_t_1;
13845 : } else {
13846 : __pyx_t_3 = __pyx_t_2;
13847 : }
13848 176 : __pyx_v_limit = __pyx_t_3;
13849 :
13850 : /* "scipy/linalg/_decomp_update.pyx":512
13851 : * cdef int limit = min(o, n)
13852 : * cdef blas_t* work
13853 : * cdef int worksize = max(m, n) # <<<<<<<<<<<<<<
13854 : *
13855 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13856 : */
13857 176 : __pyx_t_3 = __pyx_v_n;
13858 176 : __pyx_t_1 = __pyx_v_m;
13859 176 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
13860 176 : if (__pyx_t_4) {
13861 : __pyx_t_2 = __pyx_t_3;
13862 : } else {
13863 : __pyx_t_2 = __pyx_t_1;
13864 : }
13865 176 : __pyx_v_worksize = __pyx_t_2;
13866 :
13867 : /* "scipy/linalg/_decomp_update.pyx":514
13868 : * cdef int worksize = max(m, n)
13869 : *
13870 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t)) # <<<<<<<<<<<<<<
13871 : * if not work:
13872 : * return MEMORY_ERROR
13873 : */
13874 176 : __pyx_v_work = ((__pyx_t_double_complex *)malloc((__pyx_v_worksize * (sizeof(__pyx_t_double_complex)))));
13875 :
13876 : /* "scipy/linalg/_decomp_update.pyx":515
13877 : *
13878 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13879 : * if not work: # <<<<<<<<<<<<<<
13880 : * return MEMORY_ERROR
13881 : *
13882 : */
13883 176 : __pyx_t_4 = (!(__pyx_v_work != 0));
13884 176 : if (__pyx_t_4) {
13885 :
13886 : /* "scipy/linalg/_decomp_update.pyx":516
13887 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13888 : * if not work:
13889 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
13890 : *
13891 : * # move the columns to removed to the end
13892 : */
13893 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
13894 0 : goto __pyx_L0;
13895 :
13896 : /* "scipy/linalg/_decomp_update.pyx":515
13897 : *
13898 : * work = <blas_t*>libc.stdlib.malloc(worksize*sizeof(blas_t))
13899 : * if not work: # <<<<<<<<<<<<<<
13900 : * return MEMORY_ERROR
13901 : *
13902 : */
13903 : }
13904 :
13905 : /* "scipy/linalg/_decomp_update.pyx":519
13906 : *
13907 : * # move the columns to removed to the end
13908 : * for j in range(k, n-p): # <<<<<<<<<<<<<<
13909 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13910 : *
13911 : */
13912 176 : __pyx_t_2 = (__pyx_v_n - __pyx_v_p);
13913 176 : __pyx_t_3 = __pyx_t_2;
13914 952 : for (__pyx_t_1 = __pyx_v_k; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
13915 776 : __pyx_v_j = __pyx_t_1;
13916 :
13917 : /* "scipy/linalg/_decomp_update.pyx":520
13918 : * # move the columns to removed to the end
13919 : * for j in range(k, n-p):
13920 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0]) # <<<<<<<<<<<<<<
13921 : *
13922 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13923 : */
13924 776 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_limit, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + __pyx_v_p)), (__pyx_v_rs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[0]));
13925 : }
13926 :
13927 : /* "scipy/linalg/_decomp_update.pyx":522
13928 : * copy(limit, col(r, rs, j+p), rs[0], col(r, rs, j), rs[0])
13929 : *
13930 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work) # <<<<<<<<<<<<<<
13931 : *
13932 : * libc.stdlib.free(work)
13933 : */
13934 176 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_o, (__pyx_v_n - __pyx_v_p), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, __pyx_v_k, __pyx_v_p, __pyx_v_work);
13935 :
13936 : /* "scipy/linalg/_decomp_update.pyx":524
13937 : * p_subdiag_qr(m, o, n-p, q, qs, r, rs, k, p, work)
13938 : *
13939 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
13940 : * return 0
13941 : *
13942 : */
13943 176 : free(__pyx_v_work);
13944 :
13945 : /* "scipy/linalg/_decomp_update.pyx":525
13946 : *
13947 : * libc.stdlib.free(work)
13948 : * return 0 # <<<<<<<<<<<<<<
13949 : *
13950 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
13951 : */
13952 176 : __pyx_r = 0;
13953 176 : goto __pyx_L0;
13954 :
13955 : /* "scipy/linalg/_decomp_update.pyx":503
13956 : * hessenberg_qr(m, n-1, q, qs, r, rs, k)
13957 : *
13958 : * cdef int qr_block_col_delete(int m, int o, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
13959 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
13960 : * """
13961 : */
13962 :
13963 : /* function exit code */
13964 176 : __pyx_L0:;
13965 176 : return __pyx_r;
13966 : }
13967 :
13968 : /* "scipy/linalg/_decomp_update.pyx":527
13969 : * return 0
13970 : *
13971 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
13972 : * int* rs, blas_t* u, int* us, int k) noexcept nogil:
13973 : * cdef int j
13974 : */
13975 :
13976 10 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, float *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k) {
13977 10 : int __pyx_v_j;
13978 10 : float __pyx_v_c;
13979 10 : float __pyx_v_s;
13980 10 : int __pyx_t_1;
13981 10 : int __pyx_t_2;
13982 10 : int __pyx_t_3;
13983 10 : int __pyx_t_4;
13984 :
13985 : /* "scipy/linalg/_decomp_update.pyx":532
13986 : * cdef blas_t c, s
13987 : *
13988 : * for j in range(n): # <<<<<<<<<<<<<<
13989 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
13990 : * if j+1 < n:
13991 : */
13992 10 : __pyx_t_1 = __pyx_v_n;
13993 10 : __pyx_t_2 = __pyx_t_1;
13994 68 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
13995 58 : __pyx_v_j = __pyx_t_3;
13996 :
13997 : /* "scipy/linalg/_decomp_update.pyx":533
13998 : *
13999 : * for j in range(n):
14000 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s) # <<<<<<<<<<<<<<
14001 : * if j+1 < n:
14002 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14003 : */
14004 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14005 :
14006 : /* "scipy/linalg/_decomp_update.pyx":534
14007 : * for j in range(n):
14008 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14009 : * if j+1 < n: # <<<<<<<<<<<<<<
14010 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14011 : * c, s)
14012 : */
14013 58 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
14014 58 : if (__pyx_t_4) {
14015 :
14016 : /* "scipy/linalg/_decomp_update.pyx":535
14017 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14018 : * if j+1 < n:
14019 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0], # <<<<<<<<<<<<<<
14020 : * c, s)
14021 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate())
14022 : */
14023 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (__pyx_v_us[0]), __pyx_v_c, __pyx_v_s);
14024 :
14025 : /* "scipy/linalg/_decomp_update.pyx":534
14026 : * for j in range(n):
14027 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14028 : * if j+1 < n: # <<<<<<<<<<<<<<
14029 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14030 : * c, s)
14031 : */
14032 : }
14033 :
14034 : /* "scipy/linalg/_decomp_update.pyx":537
14035 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14036 : * c, s)
14037 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14038 : *
14039 : * # permute q
14040 : */
14041 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_n), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
14042 : }
14043 :
14044 : /* "scipy/linalg/_decomp_update.pyx":540
14045 : *
14046 : * # permute q
14047 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14048 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14049 : *
14050 : */
14051 10 : __pyx_t_1 = __pyx_v_k;
14052 10 : __pyx_t_2 = __pyx_t_1;
14053 93 : for (__pyx_t_3 = (__pyx_v_m - 1); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
14054 83 : __pyx_v_j = __pyx_t_3;
14055 :
14056 : /* "scipy/linalg/_decomp_update.pyx":541
14057 : * # permute q
14058 : * for j in range(m-1, k, -1):
14059 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14060 : *
14061 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
14062 : */
14063 83 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14064 : }
14065 :
14066 : /* "scipy/linalg/_decomp_update.pyx":527
14067 : * return 0
14068 : *
14069 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
14070 : * int* rs, blas_t* u, int* us, int k) noexcept nogil:
14071 : * cdef int j
14072 : */
14073 :
14074 : /* function exit code */
14075 10 : }
14076 :
14077 10 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, double *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k) {
14078 10 : int __pyx_v_j;
14079 10 : double __pyx_v_c;
14080 10 : double __pyx_v_s;
14081 10 : int __pyx_t_1;
14082 10 : int __pyx_t_2;
14083 10 : int __pyx_t_3;
14084 10 : int __pyx_t_4;
14085 :
14086 : /* "scipy/linalg/_decomp_update.pyx":532
14087 : * cdef blas_t c, s
14088 : *
14089 : * for j in range(n): # <<<<<<<<<<<<<<
14090 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14091 : * if j+1 < n:
14092 : */
14093 10 : __pyx_t_1 = __pyx_v_n;
14094 10 : __pyx_t_2 = __pyx_t_1;
14095 68 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14096 58 : __pyx_v_j = __pyx_t_3;
14097 :
14098 : /* "scipy/linalg/_decomp_update.pyx":533
14099 : *
14100 : * for j in range(n):
14101 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s) # <<<<<<<<<<<<<<
14102 : * if j+1 < n:
14103 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14104 : */
14105 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14106 :
14107 : /* "scipy/linalg/_decomp_update.pyx":534
14108 : * for j in range(n):
14109 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14110 : * if j+1 < n: # <<<<<<<<<<<<<<
14111 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14112 : * c, s)
14113 : */
14114 58 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
14115 58 : if (__pyx_t_4) {
14116 :
14117 : /* "scipy/linalg/_decomp_update.pyx":535
14118 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14119 : * if j+1 < n:
14120 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0], # <<<<<<<<<<<<<<
14121 : * c, s)
14122 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate())
14123 : */
14124 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (__pyx_v_us[0]), __pyx_v_c, __pyx_v_s);
14125 :
14126 : /* "scipy/linalg/_decomp_update.pyx":534
14127 : * for j in range(n):
14128 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14129 : * if j+1 < n: # <<<<<<<<<<<<<<
14130 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14131 : * c, s)
14132 : */
14133 : }
14134 :
14135 : /* "scipy/linalg/_decomp_update.pyx":537
14136 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14137 : * c, s)
14138 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14139 : *
14140 : * # permute q
14141 : */
14142 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_n), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
14143 : }
14144 :
14145 : /* "scipy/linalg/_decomp_update.pyx":540
14146 : *
14147 : * # permute q
14148 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14149 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14150 : *
14151 : */
14152 10 : __pyx_t_1 = __pyx_v_k;
14153 10 : __pyx_t_2 = __pyx_t_1;
14154 93 : for (__pyx_t_3 = (__pyx_v_m - 1); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
14155 83 : __pyx_v_j = __pyx_t_3;
14156 :
14157 : /* "scipy/linalg/_decomp_update.pyx":541
14158 : * # permute q
14159 : * for j in range(m-1, k, -1):
14160 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14161 : *
14162 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
14163 : */
14164 83 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14165 : }
14166 :
14167 : /* "scipy/linalg/_decomp_update.pyx":527
14168 : * return 0
14169 : *
14170 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
14171 : * int* rs, blas_t* u, int* us, int k) noexcept nogil:
14172 : * cdef int j
14173 : */
14174 :
14175 : /* function exit code */
14176 10 : }
14177 :
14178 10 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k) {
14179 10 : int __pyx_v_j;
14180 10 : __pyx_t_float_complex __pyx_v_c;
14181 10 : __pyx_t_float_complex __pyx_v_s;
14182 10 : int __pyx_t_1;
14183 10 : int __pyx_t_2;
14184 10 : int __pyx_t_3;
14185 10 : int __pyx_t_4;
14186 :
14187 : /* "scipy/linalg/_decomp_update.pyx":532
14188 : * cdef blas_t c, s
14189 : *
14190 : * for j in range(n): # <<<<<<<<<<<<<<
14191 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14192 : * if j+1 < n:
14193 : */
14194 10 : __pyx_t_1 = __pyx_v_n;
14195 10 : __pyx_t_2 = __pyx_t_1;
14196 68 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14197 58 : __pyx_v_j = __pyx_t_3;
14198 :
14199 : /* "scipy/linalg/_decomp_update.pyx":533
14200 : *
14201 : * for j in range(n):
14202 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s) # <<<<<<<<<<<<<<
14203 : * if j+1 < n:
14204 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14205 : */
14206 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14207 :
14208 : /* "scipy/linalg/_decomp_update.pyx":534
14209 : * for j in range(n):
14210 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14211 : * if j+1 < n: # <<<<<<<<<<<<<<
14212 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14213 : * c, s)
14214 : */
14215 58 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
14216 58 : if (__pyx_t_4) {
14217 :
14218 : /* "scipy/linalg/_decomp_update.pyx":535
14219 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14220 : * if j+1 < n:
14221 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0], # <<<<<<<<<<<<<<
14222 : * c, s)
14223 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate())
14224 : */
14225 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (__pyx_v_us[0]), __pyx_v_c, __pyx_v_s);
14226 :
14227 : /* "scipy/linalg/_decomp_update.pyx":534
14228 : * for j in range(n):
14229 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14230 : * if j+1 < n: # <<<<<<<<<<<<<<
14231 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14232 : * c, s)
14233 : */
14234 : }
14235 :
14236 : /* "scipy/linalg/_decomp_update.pyx":537
14237 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14238 : * c, s)
14239 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14240 : *
14241 : * # permute q
14242 : */
14243 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_n), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
14244 : }
14245 :
14246 : /* "scipy/linalg/_decomp_update.pyx":540
14247 : *
14248 : * # permute q
14249 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14250 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14251 : *
14252 : */
14253 10 : __pyx_t_1 = __pyx_v_k;
14254 10 : __pyx_t_2 = __pyx_t_1;
14255 93 : for (__pyx_t_3 = (__pyx_v_m - 1); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
14256 83 : __pyx_v_j = __pyx_t_3;
14257 :
14258 : /* "scipy/linalg/_decomp_update.pyx":541
14259 : * # permute q
14260 : * for j in range(m-1, k, -1):
14261 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14262 : *
14263 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
14264 : */
14265 83 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14266 : }
14267 :
14268 : /* "scipy/linalg/_decomp_update.pyx":527
14269 : * return 0
14270 : *
14271 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
14272 : * int* rs, blas_t* u, int* us, int k) noexcept nogil:
14273 : * cdef int j
14274 : */
14275 :
14276 : /* function exit code */
14277 10 : }
14278 :
14279 10 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k) {
14280 10 : int __pyx_v_j;
14281 10 : __pyx_t_double_complex __pyx_v_c;
14282 10 : __pyx_t_double_complex __pyx_v_s;
14283 10 : int __pyx_t_1;
14284 10 : int __pyx_t_2;
14285 10 : int __pyx_t_3;
14286 10 : int __pyx_t_4;
14287 :
14288 : /* "scipy/linalg/_decomp_update.pyx":532
14289 : * cdef blas_t c, s
14290 : *
14291 : * for j in range(n): # <<<<<<<<<<<<<<
14292 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14293 : * if j+1 < n:
14294 : */
14295 10 : __pyx_t_1 = __pyx_v_n;
14296 10 : __pyx_t_2 = __pyx_t_1;
14297 68 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14298 58 : __pyx_v_j = __pyx_t_3;
14299 :
14300 : /* "scipy/linalg/_decomp_update.pyx":533
14301 : *
14302 : * for j in range(n):
14303 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s) # <<<<<<<<<<<<<<
14304 : * if j+1 < n:
14305 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14306 : */
14307 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14308 :
14309 : /* "scipy/linalg/_decomp_update.pyx":534
14310 : * for j in range(n):
14311 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14312 : * if j+1 < n: # <<<<<<<<<<<<<<
14313 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14314 : * c, s)
14315 : */
14316 58 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
14317 58 : if (__pyx_t_4) {
14318 :
14319 : /* "scipy/linalg/_decomp_update.pyx":535
14320 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14321 : * if j+1 < n:
14322 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0], # <<<<<<<<<<<<<<
14323 : * c, s)
14324 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate())
14325 : */
14326 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (__pyx_v_us[0]), __pyx_v_c, __pyx_v_s);
14327 :
14328 : /* "scipy/linalg/_decomp_update.pyx":534
14329 : * for j in range(n):
14330 : * lartg(index2(r, rs, j, j), index1(u, us, j), &c, &s)
14331 : * if j+1 < n: # <<<<<<<<<<<<<<
14332 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14333 : * c, s)
14334 : */
14335 : }
14336 :
14337 : /* "scipy/linalg/_decomp_update.pyx":537
14338 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index1(u, us, j+1), us[0],
14339 : * c, s)
14340 : * rot(m, col(q, qs, j), qs[0], col(q, qs, n), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14341 : *
14342 : * # permute q
14343 : */
14344 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_n), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
14345 : }
14346 :
14347 : /* "scipy/linalg/_decomp_update.pyx":540
14348 : *
14349 : * # permute q
14350 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14351 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14352 : *
14353 : */
14354 10 : __pyx_t_1 = __pyx_v_k;
14355 10 : __pyx_t_2 = __pyx_t_1;
14356 93 : for (__pyx_t_3 = (__pyx_v_m - 1); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
14357 83 : __pyx_v_j = __pyx_t_3;
14358 :
14359 : /* "scipy/linalg/_decomp_update.pyx":541
14360 : * # permute q
14361 : * for j in range(m-1, k, -1):
14362 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14363 : *
14364 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
14365 : */
14366 83 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_n, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14367 : }
14368 :
14369 : /* "scipy/linalg/_decomp_update.pyx":527
14370 : * return 0
14371 : *
14372 : * cdef void thin_qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
14373 : * int* rs, blas_t* u, int* us, int k) noexcept nogil:
14374 : * cdef int j
14375 : */
14376 :
14377 : /* function exit code */
14378 10 : }
14379 :
14380 : /* "scipy/linalg/_decomp_update.pyx":543
14381 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14382 : *
14383 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
14384 : * int k) noexcept nogil:
14385 : * cdef int j
14386 : */
14387 :
14388 139 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
14389 139 : int __pyx_v_j;
14390 139 : float __pyx_v_c;
14391 139 : float __pyx_v_s;
14392 139 : int __pyx_v_limit;
14393 139 : int __pyx_t_1;
14394 139 : long __pyx_t_2;
14395 139 : long __pyx_t_3;
14396 139 : int __pyx_t_4;
14397 139 : int __pyx_t_5;
14398 139 : int __pyx_t_6;
14399 :
14400 : /* "scipy/linalg/_decomp_update.pyx":547
14401 : * cdef int j
14402 : * cdef blas_t c, s
14403 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
14404 : *
14405 : * for j in range(limit):
14406 : */
14407 139 : __pyx_t_1 = __pyx_v_n;
14408 139 : __pyx_t_2 = (__pyx_v_m - 1);
14409 139 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
14410 139 : if (__pyx_t_4) {
14411 : __pyx_t_3 = __pyx_t_1;
14412 : } else {
14413 : __pyx_t_3 = __pyx_t_2;
14414 : }
14415 139 : __pyx_v_limit = __pyx_t_3;
14416 :
14417 : /* "scipy/linalg/_decomp_update.pyx":549
14418 : * cdef int limit = min(m-1, n)
14419 : *
14420 : * for j in range(limit): # <<<<<<<<<<<<<<
14421 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14422 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14423 : */
14424 139 : __pyx_t_1 = __pyx_v_limit;
14425 139 : __pyx_t_5 = __pyx_t_1;
14426 1075 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14427 936 : __pyx_v_j = __pyx_t_6;
14428 :
14429 : /* "scipy/linalg/_decomp_update.pyx":550
14430 : *
14431 : * for j in range(limit):
14432 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s) # <<<<<<<<<<<<<<
14433 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14434 : * c, s)
14435 : */
14436 936 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14437 :
14438 : /* "scipy/linalg/_decomp_update.pyx":551
14439 : * for j in range(limit):
14440 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14441 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1], # <<<<<<<<<<<<<<
14442 : * c, s)
14443 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate())
14444 : */
14445 936 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
14446 :
14447 : /* "scipy/linalg/_decomp_update.pyx":553
14448 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14449 : * c, s)
14450 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14451 : *
14452 : * # permute q
14453 : */
14454 936 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_m - 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
14455 : }
14456 :
14457 : /* "scipy/linalg/_decomp_update.pyx":556
14458 : *
14459 : * # permute q
14460 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14461 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14462 : *
14463 : */
14464 1183 : __pyx_t_1 = __pyx_v_k;
14465 1183 : __pyx_t_5 = __pyx_t_1;
14466 1183 : for (__pyx_t_6 = (__pyx_v_m - 1); __pyx_t_6 > __pyx_t_5; __pyx_t_6-=1) {
14467 1044 : __pyx_v_j = __pyx_t_6;
14468 :
14469 : /* "scipy/linalg/_decomp_update.pyx":557
14470 : * # permute q
14471 : * for j in range(m-1, k, -1):
14472 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14473 : *
14474 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
14475 : */
14476 1044 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14477 : }
14478 :
14479 : /* "scipy/linalg/_decomp_update.pyx":543
14480 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14481 : *
14482 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
14483 : * int k) noexcept nogil:
14484 : * cdef int j
14485 : */
14486 :
14487 : /* function exit code */
14488 139 : }
14489 :
14490 139 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
14491 139 : int __pyx_v_j;
14492 139 : double __pyx_v_c;
14493 139 : double __pyx_v_s;
14494 139 : int __pyx_v_limit;
14495 139 : int __pyx_t_1;
14496 139 : long __pyx_t_2;
14497 139 : long __pyx_t_3;
14498 139 : int __pyx_t_4;
14499 139 : int __pyx_t_5;
14500 139 : int __pyx_t_6;
14501 :
14502 : /* "scipy/linalg/_decomp_update.pyx":547
14503 : * cdef int j
14504 : * cdef blas_t c, s
14505 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
14506 : *
14507 : * for j in range(limit):
14508 : */
14509 139 : __pyx_t_1 = __pyx_v_n;
14510 139 : __pyx_t_2 = (__pyx_v_m - 1);
14511 139 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
14512 139 : if (__pyx_t_4) {
14513 : __pyx_t_3 = __pyx_t_1;
14514 : } else {
14515 : __pyx_t_3 = __pyx_t_2;
14516 : }
14517 139 : __pyx_v_limit = __pyx_t_3;
14518 :
14519 : /* "scipy/linalg/_decomp_update.pyx":549
14520 : * cdef int limit = min(m-1, n)
14521 : *
14522 : * for j in range(limit): # <<<<<<<<<<<<<<
14523 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14524 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14525 : */
14526 139 : __pyx_t_1 = __pyx_v_limit;
14527 139 : __pyx_t_5 = __pyx_t_1;
14528 1075 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14529 936 : __pyx_v_j = __pyx_t_6;
14530 :
14531 : /* "scipy/linalg/_decomp_update.pyx":550
14532 : *
14533 : * for j in range(limit):
14534 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s) # <<<<<<<<<<<<<<
14535 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14536 : * c, s)
14537 : */
14538 936 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14539 :
14540 : /* "scipy/linalg/_decomp_update.pyx":551
14541 : * for j in range(limit):
14542 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14543 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1], # <<<<<<<<<<<<<<
14544 : * c, s)
14545 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate())
14546 : */
14547 936 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
14548 :
14549 : /* "scipy/linalg/_decomp_update.pyx":553
14550 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14551 : * c, s)
14552 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14553 : *
14554 : * # permute q
14555 : */
14556 936 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_m - 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
14557 : }
14558 :
14559 : /* "scipy/linalg/_decomp_update.pyx":556
14560 : *
14561 : * # permute q
14562 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14563 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14564 : *
14565 : */
14566 1183 : __pyx_t_1 = __pyx_v_k;
14567 1183 : __pyx_t_5 = __pyx_t_1;
14568 1183 : for (__pyx_t_6 = (__pyx_v_m - 1); __pyx_t_6 > __pyx_t_5; __pyx_t_6-=1) {
14569 1044 : __pyx_v_j = __pyx_t_6;
14570 :
14571 : /* "scipy/linalg/_decomp_update.pyx":557
14572 : * # permute q
14573 : * for j in range(m-1, k, -1):
14574 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14575 : *
14576 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
14577 : */
14578 1044 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14579 : }
14580 :
14581 : /* "scipy/linalg/_decomp_update.pyx":543
14582 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14583 : *
14584 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
14585 : * int k) noexcept nogil:
14586 : * cdef int j
14587 : */
14588 :
14589 : /* function exit code */
14590 139 : }
14591 :
14592 139 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
14593 139 : int __pyx_v_j;
14594 139 : __pyx_t_float_complex __pyx_v_c;
14595 139 : __pyx_t_float_complex __pyx_v_s;
14596 139 : int __pyx_v_limit;
14597 139 : int __pyx_t_1;
14598 139 : long __pyx_t_2;
14599 139 : long __pyx_t_3;
14600 139 : int __pyx_t_4;
14601 139 : int __pyx_t_5;
14602 139 : int __pyx_t_6;
14603 :
14604 : /* "scipy/linalg/_decomp_update.pyx":547
14605 : * cdef int j
14606 : * cdef blas_t c, s
14607 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
14608 : *
14609 : * for j in range(limit):
14610 : */
14611 139 : __pyx_t_1 = __pyx_v_n;
14612 139 : __pyx_t_2 = (__pyx_v_m - 1);
14613 139 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
14614 139 : if (__pyx_t_4) {
14615 : __pyx_t_3 = __pyx_t_1;
14616 : } else {
14617 : __pyx_t_3 = __pyx_t_2;
14618 : }
14619 139 : __pyx_v_limit = __pyx_t_3;
14620 :
14621 : /* "scipy/linalg/_decomp_update.pyx":549
14622 : * cdef int limit = min(m-1, n)
14623 : *
14624 : * for j in range(limit): # <<<<<<<<<<<<<<
14625 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14626 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14627 : */
14628 139 : __pyx_t_1 = __pyx_v_limit;
14629 139 : __pyx_t_5 = __pyx_t_1;
14630 1075 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14631 936 : __pyx_v_j = __pyx_t_6;
14632 :
14633 : /* "scipy/linalg/_decomp_update.pyx":550
14634 : *
14635 : * for j in range(limit):
14636 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s) # <<<<<<<<<<<<<<
14637 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14638 : * c, s)
14639 : */
14640 936 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14641 :
14642 : /* "scipy/linalg/_decomp_update.pyx":551
14643 : * for j in range(limit):
14644 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14645 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1], # <<<<<<<<<<<<<<
14646 : * c, s)
14647 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate())
14648 : */
14649 936 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
14650 :
14651 : /* "scipy/linalg/_decomp_update.pyx":553
14652 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14653 : * c, s)
14654 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14655 : *
14656 : * # permute q
14657 : */
14658 936 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_m - 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
14659 : }
14660 :
14661 : /* "scipy/linalg/_decomp_update.pyx":556
14662 : *
14663 : * # permute q
14664 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14665 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14666 : *
14667 : */
14668 1183 : __pyx_t_1 = __pyx_v_k;
14669 1183 : __pyx_t_5 = __pyx_t_1;
14670 1183 : for (__pyx_t_6 = (__pyx_v_m - 1); __pyx_t_6 > __pyx_t_5; __pyx_t_6-=1) {
14671 1044 : __pyx_v_j = __pyx_t_6;
14672 :
14673 : /* "scipy/linalg/_decomp_update.pyx":557
14674 : * # permute q
14675 : * for j in range(m-1, k, -1):
14676 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14677 : *
14678 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
14679 : */
14680 1044 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14681 : }
14682 :
14683 : /* "scipy/linalg/_decomp_update.pyx":543
14684 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14685 : *
14686 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
14687 : * int k) noexcept nogil:
14688 : * cdef int j
14689 : */
14690 :
14691 : /* function exit code */
14692 139 : }
14693 :
14694 139 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
14695 139 : int __pyx_v_j;
14696 139 : __pyx_t_double_complex __pyx_v_c;
14697 139 : __pyx_t_double_complex __pyx_v_s;
14698 139 : int __pyx_v_limit;
14699 139 : int __pyx_t_1;
14700 139 : long __pyx_t_2;
14701 139 : long __pyx_t_3;
14702 139 : int __pyx_t_4;
14703 139 : int __pyx_t_5;
14704 139 : int __pyx_t_6;
14705 :
14706 : /* "scipy/linalg/_decomp_update.pyx":547
14707 : * cdef int j
14708 : * cdef blas_t c, s
14709 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
14710 : *
14711 : * for j in range(limit):
14712 : */
14713 139 : __pyx_t_1 = __pyx_v_n;
14714 139 : __pyx_t_2 = (__pyx_v_m - 1);
14715 139 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
14716 139 : if (__pyx_t_4) {
14717 : __pyx_t_3 = __pyx_t_1;
14718 : } else {
14719 : __pyx_t_3 = __pyx_t_2;
14720 : }
14721 139 : __pyx_v_limit = __pyx_t_3;
14722 :
14723 : /* "scipy/linalg/_decomp_update.pyx":549
14724 : * cdef int limit = min(m-1, n)
14725 : *
14726 : * for j in range(limit): # <<<<<<<<<<<<<<
14727 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14728 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14729 : */
14730 139 : __pyx_t_1 = __pyx_v_limit;
14731 139 : __pyx_t_5 = __pyx_t_1;
14732 1075 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14733 936 : __pyx_v_j = __pyx_t_6;
14734 :
14735 : /* "scipy/linalg/_decomp_update.pyx":550
14736 : *
14737 : * for j in range(limit):
14738 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s) # <<<<<<<<<<<<<<
14739 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14740 : * c, s)
14741 : */
14742 936 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
14743 :
14744 : /* "scipy/linalg/_decomp_update.pyx":551
14745 : * for j in range(limit):
14746 : * lartg(index2(r, rs, j, j), index2(r, rs, m-1, j), &c, &s)
14747 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1], # <<<<<<<<<<<<<<
14748 : * c, s)
14749 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate())
14750 : */
14751 936 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_m - 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
14752 :
14753 : /* "scipy/linalg/_decomp_update.pyx":553
14754 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], index2(r, rs, m-1, j+1), rs[1],
14755 : * c, s)
14756 : * rot(m, col(q, qs, j), qs[0], col(q, qs, m-1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
14757 : *
14758 : * # permute q
14759 : */
14760 936 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_m - 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
14761 : }
14762 :
14763 : /* "scipy/linalg/_decomp_update.pyx":556
14764 : *
14765 : * # permute q
14766 : * for j in range(m-1, k, -1): # <<<<<<<<<<<<<<
14767 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14768 : *
14769 : */
14770 1183 : __pyx_t_1 = __pyx_v_k;
14771 1183 : __pyx_t_5 = __pyx_t_1;
14772 1183 : for (__pyx_t_6 = (__pyx_v_m - 1); __pyx_t_6 > __pyx_t_5; __pyx_t_6-=1) {
14773 1044 : __pyx_v_j = __pyx_t_6;
14774 :
14775 : /* "scipy/linalg/_decomp_update.pyx":557
14776 : * # permute q
14777 : * for j in range(m-1, k, -1):
14778 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1]) # <<<<<<<<<<<<<<
14779 : *
14780 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
14781 : */
14782 1044 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_swap(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_q, __pyx_v_qs, (__pyx_v_j - 1)), (__pyx_v_qs[1]));
14783 : }
14784 :
14785 : /* "scipy/linalg/_decomp_update.pyx":543
14786 : * swap(n, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14787 : *
14788 : * cdef void qr_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
14789 : * int k) noexcept nogil:
14790 : * cdef int j
14791 : */
14792 :
14793 : /* function exit code */
14794 139 : }
14795 :
14796 : /* "scipy/linalg/_decomp_update.pyx":559
14797 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
14798 : *
14799 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
14800 : * int* rs, blas_t* u, int* us, int k,
14801 : * int p) noexcept nogil:
14802 : */
14803 :
14804 10 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, float *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p) {
14805 10 : int __pyx_v_j;
14806 10 : float __pyx_v_rjj;
14807 10 : float __pyx_v_tau;
14808 10 : float *__pyx_v_work;
14809 10 : char *__pyx_v_T;
14810 10 : char *__pyx_v_N;
14811 10 : size_t __pyx_v_worksize;
14812 10 : int __pyx_r;
14813 10 : int __pyx_t_1;
14814 10 : int __pyx_t_2;
14815 10 : int __pyx_t_3;
14816 10 : int __pyx_t_4;
14817 :
14818 : /* "scipy/linalg/_decomp_update.pyx":566
14819 : * cdef blas_t rjj, tau
14820 : * cdef blas_t* work
14821 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
14822 : * cdef char* N = 'N'
14823 : * cdef size_t worksize = m * sizeof(blas_t)
14824 : */
14825 10 : __pyx_v_T = ((char *)"T");
14826 :
14827 : /* "scipy/linalg/_decomp_update.pyx":567
14828 : * cdef blas_t* work
14829 : * cdef char* T = 'T'
14830 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
14831 : * cdef size_t worksize = m * sizeof(blas_t)
14832 : *
14833 : */
14834 10 : __pyx_v_N = ((char *)"N");
14835 :
14836 : /* "scipy/linalg/_decomp_update.pyx":568
14837 : * cdef char* T = 'T'
14838 : * cdef char* N = 'N'
14839 : * cdef size_t worksize = m * sizeof(blas_t) # <<<<<<<<<<<<<<
14840 : *
14841 : * work = <blas_t*>libc.stdlib.malloc(worksize)
14842 : */
14843 10 : __pyx_v_worksize = (__pyx_v_m * (sizeof(float)));
14844 :
14845 : /* "scipy/linalg/_decomp_update.pyx":570
14846 : * cdef size_t worksize = m * sizeof(blas_t)
14847 : *
14848 : * work = <blas_t*>libc.stdlib.malloc(worksize) # <<<<<<<<<<<<<<
14849 : * if not work:
14850 : * return MEMORY_ERROR
14851 : */
14852 10 : __pyx_v_work = ((float *)malloc(__pyx_v_worksize));
14853 :
14854 : /* "scipy/linalg/_decomp_update.pyx":571
14855 : *
14856 : * work = <blas_t*>libc.stdlib.malloc(worksize)
14857 : * if not work: # <<<<<<<<<<<<<<
14858 : * return MEMORY_ERROR
14859 : *
14860 : */
14861 10 : __pyx_t_1 = (!(__pyx_v_work != 0));
14862 10 : if (__pyx_t_1) {
14863 :
14864 : /* "scipy/linalg/_decomp_update.pyx":572
14865 : * work = <blas_t*>libc.stdlib.malloc(worksize)
14866 : * if not work:
14867 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
14868 : *
14869 : * # possible FIX
14870 : */
14871 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
14872 0 : goto __pyx_L0;
14873 :
14874 : /* "scipy/linalg/_decomp_update.pyx":571
14875 : *
14876 : * work = <blas_t*>libc.stdlib.malloc(worksize)
14877 : * if not work: # <<<<<<<<<<<<<<
14878 : * return MEMORY_ERROR
14879 : *
14880 : */
14881 : }
14882 :
14883 : /* "scipy/linalg/_decomp_update.pyx":577
14884 : * # as this is written it requires F order q, r, and u. But that's not
14885 : * # strictly necessary. C order should also work too with a little fiddling.
14886 : * for j in range(n): # <<<<<<<<<<<<<<
14887 : * rjj = index2(r, rs, j, j)[0]
14888 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
14889 : */
14890 : __pyx_t_2 = __pyx_v_n;
14891 : __pyx_t_3 = __pyx_t_2;
14892 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14893 58 : __pyx_v_j = __pyx_t_4;
14894 :
14895 : /* "scipy/linalg/_decomp_update.pyx":578
14896 : * # strictly necessary. C order should also work too with a little fiddling.
14897 : * for j in range(n):
14898 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
14899 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
14900 : *
14901 : */
14902 58 : __pyx_v_rjj = (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
14903 :
14904 : /* "scipy/linalg/_decomp_update.pyx":579
14905 : * for j in range(n):
14906 : * rjj = index2(r, rs, j, j)[0]
14907 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau) # <<<<<<<<<<<<<<
14908 : *
14909 : * # here we apply the reflector by hand instead of calling larf
14910 : */
14911 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larfg((__pyx_v_p + 1), (&__pyx_v_rjj), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), (&__pyx_v_tau));
14912 :
14913 : /* "scipy/linalg/_decomp_update.pyx":585
14914 : * # are separate. This also permits the reflector to always be
14915 : * # p+1 long, rather than having a max of n+p.
14916 : * if j+1 < n: # <<<<<<<<<<<<<<
14917 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
14918 : * blas_t_conj(p, col(u, us, j), &us[0])
14919 : */
14920 58 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
14921 58 : if (__pyx_t_1) {
14922 :
14923 : /* "scipy/linalg/_decomp_update.pyx":586
14924 : * # p+1 long, rather than having a max of n+p.
14925 : * if j+1 < n:
14926 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1) # <<<<<<<<<<<<<<
14927 : * blas_t_conj(p, col(u, us, j), &us[0])
14928 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
14929 : */
14930 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work, 1);
14931 :
14932 : /* "scipy/linalg/_decomp_update.pyx":587
14933 : * if j+1 < n:
14934 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
14935 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
14936 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
14937 : * 1, work, 1)
14938 : */
14939 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
14940 :
14941 : /* "scipy/linalg/_decomp_update.pyx":588
14942 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
14943 : * blas_t_conj(p, col(u, us, j), &us[0])
14944 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0], # <<<<<<<<<<<<<<
14945 : * 1, work, 1)
14946 : * blas_t_conj(p, col(u, us, j), &us[0])
14947 : */
14948 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), 1.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), 1.0, __pyx_v_work, 1);
14949 :
14950 : /* "scipy/linalg/_decomp_update.pyx":590
14951 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
14952 : * 1, work, 1)
14953 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
14954 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
14955 : * index2(u, us, 0, j+1), p)
14956 : */
14957 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
14958 :
14959 : /* "scipy/linalg/_decomp_update.pyx":591
14960 : * 1, work, 1)
14961 : * blas_t_conj(p, col(u, us, j), &us[0])
14962 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1, # <<<<<<<<<<<<<<
14963 : * index2(u, us, 0, j+1), p)
14964 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
14965 : */
14966 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), (- (__pyx_v_tau)), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_v_work, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p);
14967 :
14968 : /* "scipy/linalg/_decomp_update.pyx":593
14969 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
14970 : * index2(u, us, 0, j+1), p)
14971 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1]) # <<<<<<<<<<<<<<
14972 : * index2(r, rs, j, j)[0] = rjj
14973 : *
14974 : */
14975 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(((__pyx_v_n - __pyx_v_j) - 1), (- (__pyx_v_tau)), __pyx_v_work, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]));
14976 :
14977 : /* "scipy/linalg/_decomp_update.pyx":585
14978 : * # are separate. This also permits the reflector to always be
14979 : * # p+1 long, rather than having a max of n+p.
14980 : * if j+1 < n: # <<<<<<<<<<<<<<
14981 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
14982 : * blas_t_conj(p, col(u, us, j), &us[0])
14983 : */
14984 : }
14985 :
14986 : /* "scipy/linalg/_decomp_update.pyx":594
14987 : * index2(u, us, 0, j+1), p)
14988 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
14989 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
14990 : *
14991 : * # now apply this reflector to q
14992 : */
14993 58 : (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
14994 :
14995 : /* "scipy/linalg/_decomp_update.pyx":597
14996 : *
14997 : * # now apply this reflector to q
14998 : * copy(m, col(q, qs, j), qs[0], work, 1) # <<<<<<<<<<<<<<
14999 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15000 : * 1, work, 1)
15001 : */
15002 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
15003 :
15004 : /* "scipy/linalg/_decomp_update.pyx":598
15005 : * # now apply this reflector to q
15006 : * copy(m, col(q, qs, j), qs[0], work, 1)
15007 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15008 : * 1, work, 1)
15009 : * blas_t_conj(p, col(u, us, j), &us[0])
15010 : */
15011 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_p, 1.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), 1.0, __pyx_v_work, 1);
15012 :
15013 : /* "scipy/linalg/_decomp_update.pyx":600
15014 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15015 : * 1, work, 1)
15016 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15017 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15018 : * index2(q, qs, 0, n), m)
15019 : */
15020 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15021 :
15022 : /* "scipy/linalg/_decomp_update.pyx":601
15023 : * 1, work, 1)
15024 : * blas_t_conj(p, col(u, us, j), &us[0])
15025 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15026 : * index2(q, qs, 0, n), m)
15027 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0])
15028 : */
15029 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_m, __pyx_v_p, (-__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m);
15030 :
15031 : /* "scipy/linalg/_decomp_update.pyx":603
15032 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15033 : * index2(q, qs, 0, n), m)
15034 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0]) # <<<<<<<<<<<<<<
15035 : *
15036 : * # permute the rows of q, work columnwise, since q is fortran order
15037 : */
15038 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_m, (-__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]));
15039 : }
15040 :
15041 : /* "scipy/linalg/_decomp_update.pyx":606
15042 : *
15043 : * # permute the rows of q, work columnwise, since q is fortran order
15044 : * if k != m-p: # <<<<<<<<<<<<<<
15045 : * for j in range(n):
15046 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15047 : */
15048 10 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
15049 10 : if (__pyx_t_1) {
15050 :
15051 : /* "scipy/linalg/_decomp_update.pyx":607
15052 : * # permute the rows of q, work columnwise, since q is fortran order
15053 : * if k != m-p:
15054 : * for j in range(n): # <<<<<<<<<<<<<<
15055 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15056 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15057 : */
15058 : __pyx_t_2 = __pyx_v_n;
15059 : __pyx_t_3 = __pyx_t_2;
15060 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15061 58 : __pyx_v_j = __pyx_t_4;
15062 :
15063 : /* "scipy/linalg/_decomp_update.pyx":608
15064 : * if k != m-p:
15065 : * for j in range(n):
15066 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
15067 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15068 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15069 : */
15070 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
15071 :
15072 : /* "scipy/linalg/_decomp_update.pyx":609
15073 : * for j in range(n):
15074 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15075 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
15076 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15077 : *
15078 : */
15079 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
15080 :
15081 : /* "scipy/linalg/_decomp_update.pyx":610
15082 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15083 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15084 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
15085 : *
15086 : * libc.stdlib.free(work)
15087 : */
15088 58 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
15089 : }
15090 :
15091 : /* "scipy/linalg/_decomp_update.pyx":606
15092 : *
15093 : * # permute the rows of q, work columnwise, since q is fortran order
15094 : * if k != m-p: # <<<<<<<<<<<<<<
15095 : * for j in range(n):
15096 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15097 : */
15098 : }
15099 :
15100 : /* "scipy/linalg/_decomp_update.pyx":612
15101 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15102 : *
15103 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
15104 : *
15105 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs,
15106 : */
15107 10 : free(__pyx_v_work);
15108 :
15109 : /* "scipy/linalg/_decomp_update.pyx":559
15110 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
15111 : *
15112 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
15113 : * int* rs, blas_t* u, int* us, int k,
15114 : * int p) noexcept nogil:
15115 : */
15116 :
15117 : /* function exit code */
15118 10 : __pyx_r = 0;
15119 10 : __pyx_L0:;
15120 10 : return __pyx_r;
15121 : }
15122 :
15123 10 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, double *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p) {
15124 10 : int __pyx_v_j;
15125 10 : double __pyx_v_rjj;
15126 10 : double __pyx_v_tau;
15127 10 : double *__pyx_v_work;
15128 10 : char *__pyx_v_T;
15129 10 : char *__pyx_v_N;
15130 10 : size_t __pyx_v_worksize;
15131 10 : int __pyx_r;
15132 10 : int __pyx_t_1;
15133 10 : int __pyx_t_2;
15134 10 : int __pyx_t_3;
15135 10 : int __pyx_t_4;
15136 :
15137 : /* "scipy/linalg/_decomp_update.pyx":566
15138 : * cdef blas_t rjj, tau
15139 : * cdef blas_t* work
15140 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
15141 : * cdef char* N = 'N'
15142 : * cdef size_t worksize = m * sizeof(blas_t)
15143 : */
15144 10 : __pyx_v_T = ((char *)"T");
15145 :
15146 : /* "scipy/linalg/_decomp_update.pyx":567
15147 : * cdef blas_t* work
15148 : * cdef char* T = 'T'
15149 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
15150 : * cdef size_t worksize = m * sizeof(blas_t)
15151 : *
15152 : */
15153 10 : __pyx_v_N = ((char *)"N");
15154 :
15155 : /* "scipy/linalg/_decomp_update.pyx":568
15156 : * cdef char* T = 'T'
15157 : * cdef char* N = 'N'
15158 : * cdef size_t worksize = m * sizeof(blas_t) # <<<<<<<<<<<<<<
15159 : *
15160 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15161 : */
15162 10 : __pyx_v_worksize = (__pyx_v_m * (sizeof(double)));
15163 :
15164 : /* "scipy/linalg/_decomp_update.pyx":570
15165 : * cdef size_t worksize = m * sizeof(blas_t)
15166 : *
15167 : * work = <blas_t*>libc.stdlib.malloc(worksize) # <<<<<<<<<<<<<<
15168 : * if not work:
15169 : * return MEMORY_ERROR
15170 : */
15171 10 : __pyx_v_work = ((double *)malloc(__pyx_v_worksize));
15172 :
15173 : /* "scipy/linalg/_decomp_update.pyx":571
15174 : *
15175 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15176 : * if not work: # <<<<<<<<<<<<<<
15177 : * return MEMORY_ERROR
15178 : *
15179 : */
15180 10 : __pyx_t_1 = (!(__pyx_v_work != 0));
15181 10 : if (__pyx_t_1) {
15182 :
15183 : /* "scipy/linalg/_decomp_update.pyx":572
15184 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15185 : * if not work:
15186 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
15187 : *
15188 : * # possible FIX
15189 : */
15190 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
15191 0 : goto __pyx_L0;
15192 :
15193 : /* "scipy/linalg/_decomp_update.pyx":571
15194 : *
15195 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15196 : * if not work: # <<<<<<<<<<<<<<
15197 : * return MEMORY_ERROR
15198 : *
15199 : */
15200 : }
15201 :
15202 : /* "scipy/linalg/_decomp_update.pyx":577
15203 : * # as this is written it requires F order q, r, and u. But that's not
15204 : * # strictly necessary. C order should also work too with a little fiddling.
15205 : * for j in range(n): # <<<<<<<<<<<<<<
15206 : * rjj = index2(r, rs, j, j)[0]
15207 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
15208 : */
15209 : __pyx_t_2 = __pyx_v_n;
15210 : __pyx_t_3 = __pyx_t_2;
15211 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15212 58 : __pyx_v_j = __pyx_t_4;
15213 :
15214 : /* "scipy/linalg/_decomp_update.pyx":578
15215 : * # strictly necessary. C order should also work too with a little fiddling.
15216 : * for j in range(n):
15217 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
15218 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
15219 : *
15220 : */
15221 58 : __pyx_v_rjj = (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
15222 :
15223 : /* "scipy/linalg/_decomp_update.pyx":579
15224 : * for j in range(n):
15225 : * rjj = index2(r, rs, j, j)[0]
15226 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau) # <<<<<<<<<<<<<<
15227 : *
15228 : * # here we apply the reflector by hand instead of calling larf
15229 : */
15230 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larfg((__pyx_v_p + 1), (&__pyx_v_rjj), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), (&__pyx_v_tau));
15231 :
15232 : /* "scipy/linalg/_decomp_update.pyx":585
15233 : * # are separate. This also permits the reflector to always be
15234 : * # p+1 long, rather than having a max of n+p.
15235 : * if j+1 < n: # <<<<<<<<<<<<<<
15236 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15237 : * blas_t_conj(p, col(u, us, j), &us[0])
15238 : */
15239 58 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
15240 58 : if (__pyx_t_1) {
15241 :
15242 : /* "scipy/linalg/_decomp_update.pyx":586
15243 : * # p+1 long, rather than having a max of n+p.
15244 : * if j+1 < n:
15245 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1) # <<<<<<<<<<<<<<
15246 : * blas_t_conj(p, col(u, us, j), &us[0])
15247 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15248 : */
15249 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work, 1);
15250 :
15251 : /* "scipy/linalg/_decomp_update.pyx":587
15252 : * if j+1 < n:
15253 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15254 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15255 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15256 : * 1, work, 1)
15257 : */
15258 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15259 :
15260 : /* "scipy/linalg/_decomp_update.pyx":588
15261 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15262 : * blas_t_conj(p, col(u, us, j), &us[0])
15263 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15264 : * 1, work, 1)
15265 : * blas_t_conj(p, col(u, us, j), &us[0])
15266 : */
15267 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), 1.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), 1.0, __pyx_v_work, 1);
15268 :
15269 : /* "scipy/linalg/_decomp_update.pyx":590
15270 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15271 : * 1, work, 1)
15272 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15273 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
15274 : * index2(u, us, 0, j+1), p)
15275 : */
15276 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15277 :
15278 : /* "scipy/linalg/_decomp_update.pyx":591
15279 : * 1, work, 1)
15280 : * blas_t_conj(p, col(u, us, j), &us[0])
15281 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1, # <<<<<<<<<<<<<<
15282 : * index2(u, us, 0, j+1), p)
15283 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
15284 : */
15285 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), (- (__pyx_v_tau)), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_v_work, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p);
15286 :
15287 : /* "scipy/linalg/_decomp_update.pyx":593
15288 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
15289 : * index2(u, us, 0, j+1), p)
15290 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1]) # <<<<<<<<<<<<<<
15291 : * index2(r, rs, j, j)[0] = rjj
15292 : *
15293 : */
15294 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(((__pyx_v_n - __pyx_v_j) - 1), (- (__pyx_v_tau)), __pyx_v_work, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]));
15295 :
15296 : /* "scipy/linalg/_decomp_update.pyx":585
15297 : * # are separate. This also permits the reflector to always be
15298 : * # p+1 long, rather than having a max of n+p.
15299 : * if j+1 < n: # <<<<<<<<<<<<<<
15300 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15301 : * blas_t_conj(p, col(u, us, j), &us[0])
15302 : */
15303 : }
15304 :
15305 : /* "scipy/linalg/_decomp_update.pyx":594
15306 : * index2(u, us, 0, j+1), p)
15307 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
15308 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
15309 : *
15310 : * # now apply this reflector to q
15311 : */
15312 58 : (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
15313 :
15314 : /* "scipy/linalg/_decomp_update.pyx":597
15315 : *
15316 : * # now apply this reflector to q
15317 : * copy(m, col(q, qs, j), qs[0], work, 1) # <<<<<<<<<<<<<<
15318 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15319 : * 1, work, 1)
15320 : */
15321 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
15322 :
15323 : /* "scipy/linalg/_decomp_update.pyx":598
15324 : * # now apply this reflector to q
15325 : * copy(m, col(q, qs, j), qs[0], work, 1)
15326 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15327 : * 1, work, 1)
15328 : * blas_t_conj(p, col(u, us, j), &us[0])
15329 : */
15330 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_p, 1.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), 1.0, __pyx_v_work, 1);
15331 :
15332 : /* "scipy/linalg/_decomp_update.pyx":600
15333 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15334 : * 1, work, 1)
15335 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15336 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15337 : * index2(q, qs, 0, n), m)
15338 : */
15339 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15340 :
15341 : /* "scipy/linalg/_decomp_update.pyx":601
15342 : * 1, work, 1)
15343 : * blas_t_conj(p, col(u, us, j), &us[0])
15344 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15345 : * index2(q, qs, 0, n), m)
15346 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0])
15347 : */
15348 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_m, __pyx_v_p, (-__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m);
15349 :
15350 : /* "scipy/linalg/_decomp_update.pyx":603
15351 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15352 : * index2(q, qs, 0, n), m)
15353 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0]) # <<<<<<<<<<<<<<
15354 : *
15355 : * # permute the rows of q, work columnwise, since q is fortran order
15356 : */
15357 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_m, (-__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]));
15358 : }
15359 :
15360 : /* "scipy/linalg/_decomp_update.pyx":606
15361 : *
15362 : * # permute the rows of q, work columnwise, since q is fortran order
15363 : * if k != m-p: # <<<<<<<<<<<<<<
15364 : * for j in range(n):
15365 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15366 : */
15367 10 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
15368 10 : if (__pyx_t_1) {
15369 :
15370 : /* "scipy/linalg/_decomp_update.pyx":607
15371 : * # permute the rows of q, work columnwise, since q is fortran order
15372 : * if k != m-p:
15373 : * for j in range(n): # <<<<<<<<<<<<<<
15374 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15375 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15376 : */
15377 : __pyx_t_2 = __pyx_v_n;
15378 : __pyx_t_3 = __pyx_t_2;
15379 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15380 58 : __pyx_v_j = __pyx_t_4;
15381 :
15382 : /* "scipy/linalg/_decomp_update.pyx":608
15383 : * if k != m-p:
15384 : * for j in range(n):
15385 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
15386 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15387 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15388 : */
15389 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
15390 :
15391 : /* "scipy/linalg/_decomp_update.pyx":609
15392 : * for j in range(n):
15393 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15394 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
15395 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15396 : *
15397 : */
15398 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
15399 :
15400 : /* "scipy/linalg/_decomp_update.pyx":610
15401 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15402 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15403 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
15404 : *
15405 : * libc.stdlib.free(work)
15406 : */
15407 58 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
15408 : }
15409 :
15410 : /* "scipy/linalg/_decomp_update.pyx":606
15411 : *
15412 : * # permute the rows of q, work columnwise, since q is fortran order
15413 : * if k != m-p: # <<<<<<<<<<<<<<
15414 : * for j in range(n):
15415 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15416 : */
15417 : }
15418 :
15419 : /* "scipy/linalg/_decomp_update.pyx":612
15420 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15421 : *
15422 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
15423 : *
15424 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs,
15425 : */
15426 10 : free(__pyx_v_work);
15427 :
15428 : /* "scipy/linalg/_decomp_update.pyx":559
15429 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
15430 : *
15431 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
15432 : * int* rs, blas_t* u, int* us, int k,
15433 : * int p) noexcept nogil:
15434 : */
15435 :
15436 : /* function exit code */
15437 10 : __pyx_r = 0;
15438 10 : __pyx_L0:;
15439 10 : return __pyx_r;
15440 : }
15441 :
15442 10 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p) {
15443 10 : int __pyx_v_j;
15444 10 : __pyx_t_float_complex __pyx_v_rjj;
15445 10 : __pyx_t_float_complex __pyx_v_tau;
15446 10 : __pyx_t_float_complex *__pyx_v_work;
15447 10 : char *__pyx_v_T;
15448 10 : char *__pyx_v_N;
15449 10 : size_t __pyx_v_worksize;
15450 10 : int __pyx_r;
15451 10 : int __pyx_t_1;
15452 10 : int __pyx_t_2;
15453 10 : int __pyx_t_3;
15454 10 : int __pyx_t_4;
15455 :
15456 : /* "scipy/linalg/_decomp_update.pyx":566
15457 : * cdef blas_t rjj, tau
15458 : * cdef blas_t* work
15459 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
15460 : * cdef char* N = 'N'
15461 : * cdef size_t worksize = m * sizeof(blas_t)
15462 : */
15463 10 : __pyx_v_T = ((char *)"T");
15464 :
15465 : /* "scipy/linalg/_decomp_update.pyx":567
15466 : * cdef blas_t* work
15467 : * cdef char* T = 'T'
15468 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
15469 : * cdef size_t worksize = m * sizeof(blas_t)
15470 : *
15471 : */
15472 10 : __pyx_v_N = ((char *)"N");
15473 :
15474 : /* "scipy/linalg/_decomp_update.pyx":568
15475 : * cdef char* T = 'T'
15476 : * cdef char* N = 'N'
15477 : * cdef size_t worksize = m * sizeof(blas_t) # <<<<<<<<<<<<<<
15478 : *
15479 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15480 : */
15481 10 : __pyx_v_worksize = (__pyx_v_m * (sizeof(__pyx_t_float_complex)));
15482 :
15483 : /* "scipy/linalg/_decomp_update.pyx":570
15484 : * cdef size_t worksize = m * sizeof(blas_t)
15485 : *
15486 : * work = <blas_t*>libc.stdlib.malloc(worksize) # <<<<<<<<<<<<<<
15487 : * if not work:
15488 : * return MEMORY_ERROR
15489 : */
15490 10 : __pyx_v_work = ((__pyx_t_float_complex *)malloc(__pyx_v_worksize));
15491 :
15492 : /* "scipy/linalg/_decomp_update.pyx":571
15493 : *
15494 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15495 : * if not work: # <<<<<<<<<<<<<<
15496 : * return MEMORY_ERROR
15497 : *
15498 : */
15499 10 : __pyx_t_1 = (!(__pyx_v_work != 0));
15500 10 : if (__pyx_t_1) {
15501 :
15502 : /* "scipy/linalg/_decomp_update.pyx":572
15503 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15504 : * if not work:
15505 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
15506 : *
15507 : * # possible FIX
15508 : */
15509 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
15510 0 : goto __pyx_L0;
15511 :
15512 : /* "scipy/linalg/_decomp_update.pyx":571
15513 : *
15514 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15515 : * if not work: # <<<<<<<<<<<<<<
15516 : * return MEMORY_ERROR
15517 : *
15518 : */
15519 : }
15520 :
15521 : /* "scipy/linalg/_decomp_update.pyx":577
15522 : * # as this is written it requires F order q, r, and u. But that's not
15523 : * # strictly necessary. C order should also work too with a little fiddling.
15524 : * for j in range(n): # <<<<<<<<<<<<<<
15525 : * rjj = index2(r, rs, j, j)[0]
15526 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
15527 : */
15528 : __pyx_t_2 = __pyx_v_n;
15529 : __pyx_t_3 = __pyx_t_2;
15530 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15531 58 : __pyx_v_j = __pyx_t_4;
15532 :
15533 : /* "scipy/linalg/_decomp_update.pyx":578
15534 : * # strictly necessary. C order should also work too with a little fiddling.
15535 : * for j in range(n):
15536 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
15537 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
15538 : *
15539 : */
15540 58 : __pyx_v_rjj = (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
15541 :
15542 : /* "scipy/linalg/_decomp_update.pyx":579
15543 : * for j in range(n):
15544 : * rjj = index2(r, rs, j, j)[0]
15545 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau) # <<<<<<<<<<<<<<
15546 : *
15547 : * # here we apply the reflector by hand instead of calling larf
15548 : */
15549 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larfg((__pyx_v_p + 1), (&__pyx_v_rjj), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), (&__pyx_v_tau));
15550 :
15551 : /* "scipy/linalg/_decomp_update.pyx":585
15552 : * # are separate. This also permits the reflector to always be
15553 : * # p+1 long, rather than having a max of n+p.
15554 : * if j+1 < n: # <<<<<<<<<<<<<<
15555 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15556 : * blas_t_conj(p, col(u, us, j), &us[0])
15557 : */
15558 58 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
15559 58 : if (__pyx_t_1) {
15560 :
15561 : /* "scipy/linalg/_decomp_update.pyx":586
15562 : * # p+1 long, rather than having a max of n+p.
15563 : * if j+1 < n:
15564 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1) # <<<<<<<<<<<<<<
15565 : * blas_t_conj(p, col(u, us, j), &us[0])
15566 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15567 : */
15568 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work, 1);
15569 :
15570 : /* "scipy/linalg/_decomp_update.pyx":587
15571 : * if j+1 < n:
15572 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15573 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15574 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15575 : * 1, work, 1)
15576 : */
15577 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15578 :
15579 : /* "scipy/linalg/_decomp_update.pyx":588
15580 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15581 : * blas_t_conj(p, col(u, us, j), &us[0])
15582 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15583 : * 1, work, 1)
15584 : * blas_t_conj(p, col(u, us, j), &us[0])
15585 : */
15586 96 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_t_float_complex_from_parts(1, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(1, 0), __pyx_v_work, 1);
15587 :
15588 : /* "scipy/linalg/_decomp_update.pyx":590
15589 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15590 : * 1, work, 1)
15591 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15592 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
15593 : * index2(u, us, 0, j+1), p)
15594 : */
15595 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15596 :
15597 : /* "scipy/linalg/_decomp_update.pyx":591
15598 : * 1, work, 1)
15599 : * blas_t_conj(p, col(u, us, j), &us[0])
15600 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1, # <<<<<<<<<<<<<<
15601 : * index2(u, us, 0, j+1), p)
15602 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
15603 : */
15604 96 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), __Pyx_c_neg_float(__Pyx_c_conj_float(__pyx_v_tau)), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_v_work, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p);
15605 :
15606 : /* "scipy/linalg/_decomp_update.pyx":593
15607 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
15608 : * index2(u, us, 0, j+1), p)
15609 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1]) # <<<<<<<<<<<<<<
15610 : * index2(r, rs, j, j)[0] = rjj
15611 : *
15612 : */
15613 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(((__pyx_v_n - __pyx_v_j) - 1), __Pyx_c_neg_float(__Pyx_c_conj_float(__pyx_v_tau)), __pyx_v_work, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]));
15614 :
15615 : /* "scipy/linalg/_decomp_update.pyx":585
15616 : * # are separate. This also permits the reflector to always be
15617 : * # p+1 long, rather than having a max of n+p.
15618 : * if j+1 < n: # <<<<<<<<<<<<<<
15619 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15620 : * blas_t_conj(p, col(u, us, j), &us[0])
15621 : */
15622 : }
15623 :
15624 : /* "scipy/linalg/_decomp_update.pyx":594
15625 : * index2(u, us, 0, j+1), p)
15626 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
15627 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
15628 : *
15629 : * # now apply this reflector to q
15630 : */
15631 58 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
15632 :
15633 : /* "scipy/linalg/_decomp_update.pyx":597
15634 : *
15635 : * # now apply this reflector to q
15636 : * copy(m, col(q, qs, j), qs[0], work, 1) # <<<<<<<<<<<<<<
15637 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15638 : * 1, work, 1)
15639 : */
15640 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
15641 :
15642 : /* "scipy/linalg/_decomp_update.pyx":598
15643 : * # now apply this reflector to q
15644 : * copy(m, col(q, qs, j), qs[0], work, 1)
15645 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15646 : * 1, work, 1)
15647 : * blas_t_conj(p, col(u, us, j), &us[0])
15648 : */
15649 116 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_p, __pyx_t_float_complex_from_parts(1, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(1, 0), __pyx_v_work, 1);
15650 :
15651 : /* "scipy/linalg/_decomp_update.pyx":600
15652 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15653 : * 1, work, 1)
15654 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15655 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15656 : * index2(q, qs, 0, n), m)
15657 : */
15658 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15659 :
15660 : /* "scipy/linalg/_decomp_update.pyx":601
15661 : * 1, work, 1)
15662 : * blas_t_conj(p, col(u, us, j), &us[0])
15663 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15664 : * index2(q, qs, 0, n), m)
15665 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0])
15666 : */
15667 116 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_m, __pyx_v_p, __Pyx_c_neg_float(__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m);
15668 :
15669 : /* "scipy/linalg/_decomp_update.pyx":603
15670 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15671 : * index2(q, qs, 0, n), m)
15672 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0]) # <<<<<<<<<<<<<<
15673 : *
15674 : * # permute the rows of q, work columnwise, since q is fortran order
15675 : */
15676 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_m, __Pyx_c_neg_float(__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]));
15677 : }
15678 :
15679 : /* "scipy/linalg/_decomp_update.pyx":606
15680 : *
15681 : * # permute the rows of q, work columnwise, since q is fortran order
15682 : * if k != m-p: # <<<<<<<<<<<<<<
15683 : * for j in range(n):
15684 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15685 : */
15686 10 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
15687 10 : if (__pyx_t_1) {
15688 :
15689 : /* "scipy/linalg/_decomp_update.pyx":607
15690 : * # permute the rows of q, work columnwise, since q is fortran order
15691 : * if k != m-p:
15692 : * for j in range(n): # <<<<<<<<<<<<<<
15693 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15694 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15695 : */
15696 : __pyx_t_2 = __pyx_v_n;
15697 : __pyx_t_3 = __pyx_t_2;
15698 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15699 58 : __pyx_v_j = __pyx_t_4;
15700 :
15701 : /* "scipy/linalg/_decomp_update.pyx":608
15702 : * if k != m-p:
15703 : * for j in range(n):
15704 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
15705 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15706 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15707 : */
15708 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
15709 :
15710 : /* "scipy/linalg/_decomp_update.pyx":609
15711 : * for j in range(n):
15712 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15713 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
15714 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15715 : *
15716 : */
15717 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
15718 :
15719 : /* "scipy/linalg/_decomp_update.pyx":610
15720 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15721 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
15722 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
15723 : *
15724 : * libc.stdlib.free(work)
15725 : */
15726 58 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
15727 : }
15728 :
15729 : /* "scipy/linalg/_decomp_update.pyx":606
15730 : *
15731 : * # permute the rows of q, work columnwise, since q is fortran order
15732 : * if k != m-p: # <<<<<<<<<<<<<<
15733 : * for j in range(n):
15734 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
15735 : */
15736 : }
15737 :
15738 : /* "scipy/linalg/_decomp_update.pyx":612
15739 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
15740 : *
15741 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
15742 : *
15743 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs,
15744 : */
15745 10 : free(__pyx_v_work);
15746 :
15747 : /* "scipy/linalg/_decomp_update.pyx":559
15748 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
15749 : *
15750 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
15751 : * int* rs, blas_t* u, int* us, int k,
15752 : * int p) noexcept nogil:
15753 : */
15754 :
15755 : /* function exit code */
15756 10 : __pyx_r = 0;
15757 10 : __pyx_L0:;
15758 10 : return __pyx_r;
15759 : }
15760 :
15761 10 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p) {
15762 10 : int __pyx_v_j;
15763 10 : __pyx_t_double_complex __pyx_v_rjj;
15764 10 : __pyx_t_double_complex __pyx_v_tau;
15765 10 : __pyx_t_double_complex *__pyx_v_work;
15766 10 : char *__pyx_v_T;
15767 10 : char *__pyx_v_N;
15768 10 : size_t __pyx_v_worksize;
15769 10 : int __pyx_r;
15770 10 : int __pyx_t_1;
15771 10 : int __pyx_t_2;
15772 10 : int __pyx_t_3;
15773 10 : int __pyx_t_4;
15774 :
15775 : /* "scipy/linalg/_decomp_update.pyx":566
15776 : * cdef blas_t rjj, tau
15777 : * cdef blas_t* work
15778 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
15779 : * cdef char* N = 'N'
15780 : * cdef size_t worksize = m * sizeof(blas_t)
15781 : */
15782 10 : __pyx_v_T = ((char *)"T");
15783 :
15784 : /* "scipy/linalg/_decomp_update.pyx":567
15785 : * cdef blas_t* work
15786 : * cdef char* T = 'T'
15787 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
15788 : * cdef size_t worksize = m * sizeof(blas_t)
15789 : *
15790 : */
15791 10 : __pyx_v_N = ((char *)"N");
15792 :
15793 : /* "scipy/linalg/_decomp_update.pyx":568
15794 : * cdef char* T = 'T'
15795 : * cdef char* N = 'N'
15796 : * cdef size_t worksize = m * sizeof(blas_t) # <<<<<<<<<<<<<<
15797 : *
15798 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15799 : */
15800 10 : __pyx_v_worksize = (__pyx_v_m * (sizeof(__pyx_t_double_complex)));
15801 :
15802 : /* "scipy/linalg/_decomp_update.pyx":570
15803 : * cdef size_t worksize = m * sizeof(blas_t)
15804 : *
15805 : * work = <blas_t*>libc.stdlib.malloc(worksize) # <<<<<<<<<<<<<<
15806 : * if not work:
15807 : * return MEMORY_ERROR
15808 : */
15809 10 : __pyx_v_work = ((__pyx_t_double_complex *)malloc(__pyx_v_worksize));
15810 :
15811 : /* "scipy/linalg/_decomp_update.pyx":571
15812 : *
15813 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15814 : * if not work: # <<<<<<<<<<<<<<
15815 : * return MEMORY_ERROR
15816 : *
15817 : */
15818 10 : __pyx_t_1 = (!(__pyx_v_work != 0));
15819 10 : if (__pyx_t_1) {
15820 :
15821 : /* "scipy/linalg/_decomp_update.pyx":572
15822 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15823 : * if not work:
15824 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
15825 : *
15826 : * # possible FIX
15827 : */
15828 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
15829 0 : goto __pyx_L0;
15830 :
15831 : /* "scipy/linalg/_decomp_update.pyx":571
15832 : *
15833 : * work = <blas_t*>libc.stdlib.malloc(worksize)
15834 : * if not work: # <<<<<<<<<<<<<<
15835 : * return MEMORY_ERROR
15836 : *
15837 : */
15838 : }
15839 :
15840 : /* "scipy/linalg/_decomp_update.pyx":577
15841 : * # as this is written it requires F order q, r, and u. But that's not
15842 : * # strictly necessary. C order should also work too with a little fiddling.
15843 : * for j in range(n): # <<<<<<<<<<<<<<
15844 : * rjj = index2(r, rs, j, j)[0]
15845 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
15846 : */
15847 : __pyx_t_2 = __pyx_v_n;
15848 : __pyx_t_3 = __pyx_t_2;
15849 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15850 58 : __pyx_v_j = __pyx_t_4;
15851 :
15852 : /* "scipy/linalg/_decomp_update.pyx":578
15853 : * # strictly necessary. C order should also work too with a little fiddling.
15854 : * for j in range(n):
15855 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
15856 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau)
15857 : *
15858 : */
15859 58 : __pyx_v_rjj = (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
15860 :
15861 : /* "scipy/linalg/_decomp_update.pyx":579
15862 : * for j in range(n):
15863 : * rjj = index2(r, rs, j, j)[0]
15864 : * larfg(p+1, &rjj, col(u, us, j), us[0], &tau) # <<<<<<<<<<<<<<
15865 : *
15866 : * # here we apply the reflector by hand instead of calling larf
15867 : */
15868 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larfg((__pyx_v_p + 1), (&__pyx_v_rjj), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), (&__pyx_v_tau));
15869 :
15870 : /* "scipy/linalg/_decomp_update.pyx":585
15871 : * # are separate. This also permits the reflector to always be
15872 : * # p+1 long, rather than having a max of n+p.
15873 : * if j+1 < n: # <<<<<<<<<<<<<<
15874 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15875 : * blas_t_conj(p, col(u, us, j), &us[0])
15876 : */
15877 58 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
15878 58 : if (__pyx_t_1) {
15879 :
15880 : /* "scipy/linalg/_decomp_update.pyx":586
15881 : * # p+1 long, rather than having a max of n+p.
15882 : * if j+1 < n:
15883 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1) # <<<<<<<<<<<<<<
15884 : * blas_t_conj(p, col(u, us, j), &us[0])
15885 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15886 : */
15887 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work, 1);
15888 :
15889 : /* "scipy/linalg/_decomp_update.pyx":587
15890 : * if j+1 < n:
15891 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15892 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15893 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15894 : * 1, work, 1)
15895 : */
15896 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15897 :
15898 : /* "scipy/linalg/_decomp_update.pyx":588
15899 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15900 : * blas_t_conj(p, col(u, us, j), &us[0])
15901 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15902 : * 1, work, 1)
15903 : * blas_t_conj(p, col(u, us, j), &us[0])
15904 : */
15905 96 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_t_double_complex_from_parts(1, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(1, 0), __pyx_v_work, 1);
15906 :
15907 : /* "scipy/linalg/_decomp_update.pyx":590
15908 : * gemv(T, p, n-j-1, 1, index2(u, us, 0, j+1), p, col(u, us, j), us[0],
15909 : * 1, work, 1)
15910 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15911 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
15912 : * index2(u, us, 0, j+1), p)
15913 : */
15914 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15915 :
15916 : /* "scipy/linalg/_decomp_update.pyx":591
15917 : * 1, work, 1)
15918 : * blas_t_conj(p, col(u, us, j), &us[0])
15919 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1, # <<<<<<<<<<<<<<
15920 : * index2(u, us, 0, j+1), p)
15921 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
15922 : */
15923 96 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_p, ((__pyx_v_n - __pyx_v_j) - 1), __Pyx_c_neg_double(__Pyx_c_conj_double(__pyx_v_tau)), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_v_work, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, 0, (__pyx_v_j + 1)), __pyx_v_p);
15924 :
15925 : /* "scipy/linalg/_decomp_update.pyx":593
15926 : * ger(p, n-j-1, -tau.conjugate(), col(u, us, j), us[0], work, 1,
15927 : * index2(u, us, 0, j+1), p)
15928 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1]) # <<<<<<<<<<<<<<
15929 : * index2(r, rs, j, j)[0] = rjj
15930 : *
15931 : */
15932 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(((__pyx_v_n - __pyx_v_j) - 1), __Pyx_c_neg_double(__Pyx_c_conj_double(__pyx_v_tau)), __pyx_v_work, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]));
15933 :
15934 : /* "scipy/linalg/_decomp_update.pyx":585
15935 : * # are separate. This also permits the reflector to always be
15936 : * # p+1 long, rather than having a max of n+p.
15937 : * if j+1 < n: # <<<<<<<<<<<<<<
15938 : * copy(n-j-1, index2(r, rs, j, j+1), rs[1], work, 1)
15939 : * blas_t_conj(p, col(u, us, j), &us[0])
15940 : */
15941 : }
15942 :
15943 : /* "scipy/linalg/_decomp_update.pyx":594
15944 : * index2(u, us, 0, j+1), p)
15945 : * axpy(n-j-1, -tau.conjugate(), work, 1, index2(r, rs, j, j+1), rs[1])
15946 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
15947 : *
15948 : * # now apply this reflector to q
15949 : */
15950 58 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
15951 :
15952 : /* "scipy/linalg/_decomp_update.pyx":597
15953 : *
15954 : * # now apply this reflector to q
15955 : * copy(m, col(q, qs, j), qs[0], work, 1) # <<<<<<<<<<<<<<
15956 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15957 : * 1, work, 1)
15958 : */
15959 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
15960 :
15961 : /* "scipy/linalg/_decomp_update.pyx":598
15962 : * # now apply this reflector to q
15963 : * copy(m, col(q, qs, j), qs[0], work, 1)
15964 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15965 : * 1, work, 1)
15966 : * blas_t_conj(p, col(u, us, j), &us[0])
15967 : */
15968 116 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_p, __pyx_t_double_complex_from_parts(1, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(1, 0), __pyx_v_work, 1);
15969 :
15970 : /* "scipy/linalg/_decomp_update.pyx":600
15971 : * gemv(N, m, p, 1, index2(q, qs, 0, n), m, col(u, us, j), us[0],
15972 : * 1, work, 1)
15973 : * blas_t_conj(p, col(u, us, j), &us[0]) # <<<<<<<<<<<<<<
15974 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15975 : * index2(q, qs, 0, n), m)
15976 : */
15977 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (&(__pyx_v_us[0])));
15978 :
15979 : /* "scipy/linalg/_decomp_update.pyx":601
15980 : * 1, work, 1)
15981 : * blas_t_conj(p, col(u, us, j), &us[0])
15982 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0], # <<<<<<<<<<<<<<
15983 : * index2(q, qs, 0, n), m)
15984 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0])
15985 : */
15986 116 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ger(__pyx_v_m, __pyx_v_p, __Pyx_c_neg_double(__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m);
15987 :
15988 : /* "scipy/linalg/_decomp_update.pyx":603
15989 : * ger(m, p, -tau, work, 1, col(u, us, j), us[0],
15990 : * index2(q, qs, 0, n), m)
15991 : * axpy(m, -tau, work, 1, col(q, qs, j), qs[0]) # <<<<<<<<<<<<<<
15992 : *
15993 : * # permute the rows of q, work columnwise, since q is fortran order
15994 : */
15995 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_m, __Pyx_c_neg_double(__pyx_v_tau), __pyx_v_work, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]));
15996 : }
15997 :
15998 : /* "scipy/linalg/_decomp_update.pyx":606
15999 : *
16000 : * # permute the rows of q, work columnwise, since q is fortran order
16001 : * if k != m-p: # <<<<<<<<<<<<<<
16002 : * for j in range(n):
16003 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16004 : */
16005 10 : __pyx_t_1 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
16006 10 : if (__pyx_t_1) {
16007 :
16008 : /* "scipy/linalg/_decomp_update.pyx":607
16009 : * # permute the rows of q, work columnwise, since q is fortran order
16010 : * if k != m-p:
16011 : * for j in range(n): # <<<<<<<<<<<<<<
16012 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16013 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16014 : */
16015 : __pyx_t_2 = __pyx_v_n;
16016 : __pyx_t_3 = __pyx_t_2;
16017 68 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16018 58 : __pyx_v_j = __pyx_t_4;
16019 :
16020 : /* "scipy/linalg/_decomp_update.pyx":608
16021 : * if k != m-p:
16022 : * for j in range(n):
16023 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
16024 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16025 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16026 : */
16027 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
16028 :
16029 : /* "scipy/linalg/_decomp_update.pyx":609
16030 : * for j in range(n):
16031 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16032 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
16033 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16034 : *
16035 : */
16036 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
16037 :
16038 : /* "scipy/linalg/_decomp_update.pyx":610
16039 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16040 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16041 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
16042 : *
16043 : * libc.stdlib.free(work)
16044 : */
16045 58 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
16046 : }
16047 :
16048 : /* "scipy/linalg/_decomp_update.pyx":606
16049 : *
16050 : * # permute the rows of q, work columnwise, since q is fortran order
16051 : * if k != m-p: # <<<<<<<<<<<<<<
16052 : * for j in range(n):
16053 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16054 : */
16055 : }
16056 :
16057 : /* "scipy/linalg/_decomp_update.pyx":612
16058 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16059 : *
16060 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
16061 : *
16062 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs,
16063 : */
16064 10 : free(__pyx_v_work);
16065 :
16066 : /* "scipy/linalg/_decomp_update.pyx":559
16067 : * swap(m, row(q, qs, j), qs[1], row(q, qs, j-1), qs[1])
16068 : *
16069 : * cdef int thin_qr_block_row_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
16070 : * int* rs, blas_t* u, int* us, int k,
16071 : * int p) noexcept nogil:
16072 : */
16073 :
16074 : /* function exit code */
16075 10 : __pyx_r = 0;
16076 10 : __pyx_L0:;
16077 10 : return __pyx_r;
16078 : }
16079 :
16080 : /* "scipy/linalg/_decomp_update.pyx":614
16081 : * libc.stdlib.free(work)
16082 : *
16083 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
16084 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
16085 : * # this should someday call lapack's xtpqrt (requires lapack >= 3.4
16086 : */
16087 :
16088 155 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
16089 155 : int __pyx_v_j;
16090 155 : int __pyx_v_hlen;
16091 155 : float __pyx_v_rjj;
16092 155 : float __pyx_v_tau;
16093 155 : float *__pyx_v_work;
16094 155 : char *__pyx_v_sideL;
16095 155 : char *__pyx_v_sideR;
16096 155 : int __pyx_v_limit;
16097 155 : int __pyx_r;
16098 155 : int __pyx_t_1;
16099 155 : int __pyx_t_2;
16100 155 : int __pyx_t_3;
16101 155 : int __pyx_t_4;
16102 :
16103 : /* "scipy/linalg/_decomp_update.pyx":633
16104 : * cdef blas_t rjj, tau
16105 : * cdef blas_t* work
16106 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
16107 : * cdef char* sideR = 'R'
16108 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16109 : */
16110 155 : __pyx_v_sideL = ((char *)"L");
16111 :
16112 : /* "scipy/linalg/_decomp_update.pyx":634
16113 : * cdef blas_t* work
16114 : * cdef char* sideL = 'L'
16115 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
16116 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16117 : * cdef int limit = min(m, n)
16118 : */
16119 155 : __pyx_v_sideR = ((char *)"R");
16120 :
16121 : /* "scipy/linalg/_decomp_update.pyx":636
16122 : * cdef char* sideR = 'R'
16123 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16124 : * cdef int limit = min(m, n) # <<<<<<<<<<<<<<
16125 : *
16126 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16127 : */
16128 155 : __pyx_t_1 = __pyx_v_n;
16129 155 : __pyx_t_2 = __pyx_v_m;
16130 155 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
16131 155 : if (__pyx_t_4) {
16132 : __pyx_t_3 = __pyx_t_1;
16133 : } else {
16134 : __pyx_t_3 = __pyx_t_2;
16135 : }
16136 155 : __pyx_v_limit = __pyx_t_3;
16137 :
16138 : /* "scipy/linalg/_decomp_update.pyx":638
16139 : * cdef int limit = min(m, n)
16140 : *
16141 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t)) # <<<<<<<<<<<<<<
16142 : * if not work:
16143 : * return MEMORY_ERROR
16144 : */
16145 155 : __pyx_t_3 = __pyx_v_n;
16146 155 : __pyx_t_1 = __pyx_v_m;
16147 155 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
16148 155 : if (__pyx_t_4) {
16149 : __pyx_t_2 = __pyx_t_3;
16150 : } else {
16151 : __pyx_t_2 = __pyx_t_1;
16152 : }
16153 155 : __pyx_v_work = ((float *)malloc((__pyx_t_2 * (sizeof(float)))));
16154 :
16155 : /* "scipy/linalg/_decomp_update.pyx":639
16156 : *
16157 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16158 : * if not work: # <<<<<<<<<<<<<<
16159 : * return MEMORY_ERROR
16160 : *
16161 : */
16162 155 : __pyx_t_4 = (!(__pyx_v_work != 0));
16163 155 : if (__pyx_t_4) {
16164 :
16165 : /* "scipy/linalg/_decomp_update.pyx":640
16166 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16167 : * if not work:
16168 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
16169 : *
16170 : * for j in range(limit):
16171 : */
16172 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
16173 0 : goto __pyx_L0;
16174 :
16175 : /* "scipy/linalg/_decomp_update.pyx":639
16176 : *
16177 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16178 : * if not work: # <<<<<<<<<<<<<<
16179 : * return MEMORY_ERROR
16180 : *
16181 : */
16182 : }
16183 :
16184 : /* "scipy/linalg/_decomp_update.pyx":642
16185 : * return MEMORY_ERROR
16186 : *
16187 : * for j in range(limit): # <<<<<<<<<<<<<<
16188 : * rjj = index2(r, rs, j, j)[0]
16189 : * hlen = m-j
16190 : */
16191 1409 : __pyx_t_2 = __pyx_v_limit;
16192 1409 : __pyx_t_3 = __pyx_t_2;
16193 1409 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
16194 1254 : __pyx_v_j = __pyx_t_1;
16195 :
16196 : /* "scipy/linalg/_decomp_update.pyx":643
16197 : *
16198 : * for j in range(limit):
16199 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
16200 : * hlen = m-j
16201 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16202 : */
16203 1254 : __pyx_v_rjj = (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
16204 :
16205 : /* "scipy/linalg/_decomp_update.pyx":644
16206 : * for j in range(limit):
16207 : * rjj = index2(r, rs, j, j)[0]
16208 : * hlen = m-j # <<<<<<<<<<<<<<
16209 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16210 : * index2(r, rs, j, j)[0] = 1
16211 : */
16212 1254 : __pyx_v_hlen = (__pyx_v_m - __pyx_v_j);
16213 :
16214 : /* "scipy/linalg/_decomp_update.pyx":645
16215 : * rjj = index2(r, rs, j, j)[0]
16216 : * hlen = m-j
16217 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
16218 : * index2(r, rs, j, j)[0] = 1
16219 : * if j+1 < n:
16220 : */
16221 1254 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_hlen, (&__pyx_v_rjj), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
16222 :
16223 : /* "scipy/linalg/_decomp_update.pyx":646
16224 : * hlen = m-j
16225 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16226 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
16227 : * if j+1 < n:
16228 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16229 : */
16230 1254 : (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = 1.0;
16231 :
16232 : /* "scipy/linalg/_decomp_update.pyx":647
16233 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16234 : * index2(r, rs, j, j)[0] = 1
16235 : * if j+1 < n: # <<<<<<<<<<<<<<
16236 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16237 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16238 : */
16239 1254 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
16240 1254 : if (__pyx_t_4) {
16241 :
16242 : /* "scipy/linalg/_decomp_update.pyx":648
16243 : * index2(r, rs, j, j)[0] = 1
16244 : * if j+1 < n:
16245 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
16246 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16247 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
16248 : */
16249 1141 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_hlen, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), (__pyx_v_tau), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
16250 :
16251 : /* "scipy/linalg/_decomp_update.pyx":647
16252 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16253 : * index2(r, rs, j, j)[0] = 1
16254 : * if j+1 < n: # <<<<<<<<<<<<<<
16255 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16256 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16257 : */
16258 : }
16259 :
16260 : /* "scipy/linalg/_decomp_update.pyx":650
16261 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16262 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16263 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
16264 : * index2(q, qs, 0, j), qs[1], work)
16265 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
16266 : */
16267 1254 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_hlen, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
16268 :
16269 : /* "scipy/linalg/_decomp_update.pyx":652
16270 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
16271 : * index2(q, qs, 0, j), qs[1], work)
16272 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t)) # <<<<<<<<<<<<<<
16273 : * index2(r, rs, j, j)[0] = rjj
16274 : *
16275 : */
16276 1254 : (void)(memset(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), 0, (__pyx_v_hlen * (sizeof(float)))));
16277 :
16278 : /* "scipy/linalg/_decomp_update.pyx":653
16279 : * index2(q, qs, 0, j), qs[1], work)
16280 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
16281 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
16282 : *
16283 : * # permute the rows., work columnwise, since q is fortran order
16284 : */
16285 1254 : (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
16286 : }
16287 :
16288 : /* "scipy/linalg/_decomp_update.pyx":656
16289 : *
16290 : * # permute the rows., work columnwise, since q is fortran order
16291 : * if k != m-p: # <<<<<<<<<<<<<<
16292 : * for j in range(m):
16293 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16294 : */
16295 155 : __pyx_t_4 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
16296 155 : if (__pyx_t_4) {
16297 :
16298 : /* "scipy/linalg/_decomp_update.pyx":657
16299 : * # permute the rows., work columnwise, since q is fortran order
16300 : * if k != m-p:
16301 : * for j in range(m): # <<<<<<<<<<<<<<
16302 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16303 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16304 : */
16305 1915 : __pyx_t_2 = __pyx_v_m;
16306 1915 : __pyx_t_3 = __pyx_t_2;
16307 1915 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
16308 1768 : __pyx_v_j = __pyx_t_1;
16309 :
16310 : /* "scipy/linalg/_decomp_update.pyx":658
16311 : * if k != m-p:
16312 : * for j in range(m):
16313 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
16314 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16315 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16316 : */
16317 1768 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
16318 :
16319 : /* "scipy/linalg/_decomp_update.pyx":659
16320 : * for j in range(m):
16321 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16322 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
16323 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16324 : *
16325 : */
16326 1768 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
16327 :
16328 : /* "scipy/linalg/_decomp_update.pyx":660
16329 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16330 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16331 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
16332 : *
16333 : * libc.stdlib.free(work)
16334 : */
16335 1768 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
16336 : }
16337 :
16338 : /* "scipy/linalg/_decomp_update.pyx":656
16339 : *
16340 : * # permute the rows., work columnwise, since q is fortran order
16341 : * if k != m-p: # <<<<<<<<<<<<<<
16342 : * for j in range(m):
16343 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16344 : */
16345 : }
16346 :
16347 : /* "scipy/linalg/_decomp_update.pyx":662
16348 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16349 : *
16350 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
16351 : * return 0
16352 : *
16353 : */
16354 155 : free(__pyx_v_work);
16355 :
16356 : /* "scipy/linalg/_decomp_update.pyx":663
16357 : *
16358 : * libc.stdlib.free(work)
16359 : * return 0 # <<<<<<<<<<<<<<
16360 : *
16361 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
16362 : */
16363 155 : __pyx_r = 0;
16364 155 : goto __pyx_L0;
16365 :
16366 : /* "scipy/linalg/_decomp_update.pyx":614
16367 : * libc.stdlib.free(work)
16368 : *
16369 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
16370 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
16371 : * # this should someday call lapack's xtpqrt (requires lapack >= 3.4
16372 : */
16373 :
16374 : /* function exit code */
16375 155 : __pyx_L0:;
16376 155 : return __pyx_r;
16377 : }
16378 :
16379 155 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
16380 155 : int __pyx_v_j;
16381 155 : int __pyx_v_hlen;
16382 155 : double __pyx_v_rjj;
16383 155 : double __pyx_v_tau;
16384 155 : double *__pyx_v_work;
16385 155 : char *__pyx_v_sideL;
16386 155 : char *__pyx_v_sideR;
16387 155 : int __pyx_v_limit;
16388 155 : int __pyx_r;
16389 155 : int __pyx_t_1;
16390 155 : int __pyx_t_2;
16391 155 : int __pyx_t_3;
16392 155 : int __pyx_t_4;
16393 :
16394 : /* "scipy/linalg/_decomp_update.pyx":633
16395 : * cdef blas_t rjj, tau
16396 : * cdef blas_t* work
16397 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
16398 : * cdef char* sideR = 'R'
16399 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16400 : */
16401 155 : __pyx_v_sideL = ((char *)"L");
16402 :
16403 : /* "scipy/linalg/_decomp_update.pyx":634
16404 : * cdef blas_t* work
16405 : * cdef char* sideL = 'L'
16406 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
16407 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16408 : * cdef int limit = min(m, n)
16409 : */
16410 155 : __pyx_v_sideR = ((char *)"R");
16411 :
16412 : /* "scipy/linalg/_decomp_update.pyx":636
16413 : * cdef char* sideR = 'R'
16414 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16415 : * cdef int limit = min(m, n) # <<<<<<<<<<<<<<
16416 : *
16417 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16418 : */
16419 155 : __pyx_t_1 = __pyx_v_n;
16420 155 : __pyx_t_2 = __pyx_v_m;
16421 155 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
16422 155 : if (__pyx_t_4) {
16423 : __pyx_t_3 = __pyx_t_1;
16424 : } else {
16425 : __pyx_t_3 = __pyx_t_2;
16426 : }
16427 155 : __pyx_v_limit = __pyx_t_3;
16428 :
16429 : /* "scipy/linalg/_decomp_update.pyx":638
16430 : * cdef int limit = min(m, n)
16431 : *
16432 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t)) # <<<<<<<<<<<<<<
16433 : * if not work:
16434 : * return MEMORY_ERROR
16435 : */
16436 155 : __pyx_t_3 = __pyx_v_n;
16437 155 : __pyx_t_1 = __pyx_v_m;
16438 155 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
16439 155 : if (__pyx_t_4) {
16440 : __pyx_t_2 = __pyx_t_3;
16441 : } else {
16442 : __pyx_t_2 = __pyx_t_1;
16443 : }
16444 155 : __pyx_v_work = ((double *)malloc((__pyx_t_2 * (sizeof(double)))));
16445 :
16446 : /* "scipy/linalg/_decomp_update.pyx":639
16447 : *
16448 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16449 : * if not work: # <<<<<<<<<<<<<<
16450 : * return MEMORY_ERROR
16451 : *
16452 : */
16453 155 : __pyx_t_4 = (!(__pyx_v_work != 0));
16454 155 : if (__pyx_t_4) {
16455 :
16456 : /* "scipy/linalg/_decomp_update.pyx":640
16457 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16458 : * if not work:
16459 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
16460 : *
16461 : * for j in range(limit):
16462 : */
16463 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
16464 0 : goto __pyx_L0;
16465 :
16466 : /* "scipy/linalg/_decomp_update.pyx":639
16467 : *
16468 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16469 : * if not work: # <<<<<<<<<<<<<<
16470 : * return MEMORY_ERROR
16471 : *
16472 : */
16473 : }
16474 :
16475 : /* "scipy/linalg/_decomp_update.pyx":642
16476 : * return MEMORY_ERROR
16477 : *
16478 : * for j in range(limit): # <<<<<<<<<<<<<<
16479 : * rjj = index2(r, rs, j, j)[0]
16480 : * hlen = m-j
16481 : */
16482 1409 : __pyx_t_2 = __pyx_v_limit;
16483 1409 : __pyx_t_3 = __pyx_t_2;
16484 1409 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
16485 1254 : __pyx_v_j = __pyx_t_1;
16486 :
16487 : /* "scipy/linalg/_decomp_update.pyx":643
16488 : *
16489 : * for j in range(limit):
16490 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
16491 : * hlen = m-j
16492 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16493 : */
16494 1254 : __pyx_v_rjj = (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
16495 :
16496 : /* "scipy/linalg/_decomp_update.pyx":644
16497 : * for j in range(limit):
16498 : * rjj = index2(r, rs, j, j)[0]
16499 : * hlen = m-j # <<<<<<<<<<<<<<
16500 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16501 : * index2(r, rs, j, j)[0] = 1
16502 : */
16503 1254 : __pyx_v_hlen = (__pyx_v_m - __pyx_v_j);
16504 :
16505 : /* "scipy/linalg/_decomp_update.pyx":645
16506 : * rjj = index2(r, rs, j, j)[0]
16507 : * hlen = m-j
16508 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
16509 : * index2(r, rs, j, j)[0] = 1
16510 : * if j+1 < n:
16511 : */
16512 1254 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_hlen, (&__pyx_v_rjj), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
16513 :
16514 : /* "scipy/linalg/_decomp_update.pyx":646
16515 : * hlen = m-j
16516 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16517 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
16518 : * if j+1 < n:
16519 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16520 : */
16521 1254 : (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = 1.0;
16522 :
16523 : /* "scipy/linalg/_decomp_update.pyx":647
16524 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16525 : * index2(r, rs, j, j)[0] = 1
16526 : * if j+1 < n: # <<<<<<<<<<<<<<
16527 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16528 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16529 : */
16530 1254 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
16531 1254 : if (__pyx_t_4) {
16532 :
16533 : /* "scipy/linalg/_decomp_update.pyx":648
16534 : * index2(r, rs, j, j)[0] = 1
16535 : * if j+1 < n:
16536 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
16537 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16538 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
16539 : */
16540 1141 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_hlen, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), (__pyx_v_tau), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
16541 :
16542 : /* "scipy/linalg/_decomp_update.pyx":647
16543 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16544 : * index2(r, rs, j, j)[0] = 1
16545 : * if j+1 < n: # <<<<<<<<<<<<<<
16546 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16547 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16548 : */
16549 : }
16550 :
16551 : /* "scipy/linalg/_decomp_update.pyx":650
16552 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16553 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16554 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
16555 : * index2(q, qs, 0, j), qs[1], work)
16556 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
16557 : */
16558 1254 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_hlen, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
16559 :
16560 : /* "scipy/linalg/_decomp_update.pyx":652
16561 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
16562 : * index2(q, qs, 0, j), qs[1], work)
16563 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t)) # <<<<<<<<<<<<<<
16564 : * index2(r, rs, j, j)[0] = rjj
16565 : *
16566 : */
16567 1254 : (void)(memset(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), 0, (__pyx_v_hlen * (sizeof(double)))));
16568 :
16569 : /* "scipy/linalg/_decomp_update.pyx":653
16570 : * index2(q, qs, 0, j), qs[1], work)
16571 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
16572 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
16573 : *
16574 : * # permute the rows., work columnwise, since q is fortran order
16575 : */
16576 1254 : (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
16577 : }
16578 :
16579 : /* "scipy/linalg/_decomp_update.pyx":656
16580 : *
16581 : * # permute the rows., work columnwise, since q is fortran order
16582 : * if k != m-p: # <<<<<<<<<<<<<<
16583 : * for j in range(m):
16584 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16585 : */
16586 155 : __pyx_t_4 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
16587 155 : if (__pyx_t_4) {
16588 :
16589 : /* "scipy/linalg/_decomp_update.pyx":657
16590 : * # permute the rows., work columnwise, since q is fortran order
16591 : * if k != m-p:
16592 : * for j in range(m): # <<<<<<<<<<<<<<
16593 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16594 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16595 : */
16596 1915 : __pyx_t_2 = __pyx_v_m;
16597 1915 : __pyx_t_3 = __pyx_t_2;
16598 1915 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
16599 1768 : __pyx_v_j = __pyx_t_1;
16600 :
16601 : /* "scipy/linalg/_decomp_update.pyx":658
16602 : * if k != m-p:
16603 : * for j in range(m):
16604 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
16605 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16606 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16607 : */
16608 1768 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
16609 :
16610 : /* "scipy/linalg/_decomp_update.pyx":659
16611 : * for j in range(m):
16612 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16613 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
16614 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16615 : *
16616 : */
16617 1768 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
16618 :
16619 : /* "scipy/linalg/_decomp_update.pyx":660
16620 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16621 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16622 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
16623 : *
16624 : * libc.stdlib.free(work)
16625 : */
16626 1768 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
16627 : }
16628 :
16629 : /* "scipy/linalg/_decomp_update.pyx":656
16630 : *
16631 : * # permute the rows., work columnwise, since q is fortran order
16632 : * if k != m-p: # <<<<<<<<<<<<<<
16633 : * for j in range(m):
16634 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16635 : */
16636 : }
16637 :
16638 : /* "scipy/linalg/_decomp_update.pyx":662
16639 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16640 : *
16641 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
16642 : * return 0
16643 : *
16644 : */
16645 155 : free(__pyx_v_work);
16646 :
16647 : /* "scipy/linalg/_decomp_update.pyx":663
16648 : *
16649 : * libc.stdlib.free(work)
16650 : * return 0 # <<<<<<<<<<<<<<
16651 : *
16652 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
16653 : */
16654 155 : __pyx_r = 0;
16655 155 : goto __pyx_L0;
16656 :
16657 : /* "scipy/linalg/_decomp_update.pyx":614
16658 : * libc.stdlib.free(work)
16659 : *
16660 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
16661 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
16662 : * # this should someday call lapack's xtpqrt (requires lapack >= 3.4
16663 : */
16664 :
16665 : /* function exit code */
16666 155 : __pyx_L0:;
16667 155 : return __pyx_r;
16668 : }
16669 :
16670 155 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
16671 155 : int __pyx_v_j;
16672 155 : int __pyx_v_hlen;
16673 155 : __pyx_t_float_complex __pyx_v_rjj;
16674 155 : __pyx_t_float_complex __pyx_v_tau;
16675 155 : __pyx_t_float_complex *__pyx_v_work;
16676 155 : char *__pyx_v_sideL;
16677 155 : char *__pyx_v_sideR;
16678 155 : int __pyx_v_limit;
16679 155 : int __pyx_r;
16680 155 : int __pyx_t_1;
16681 155 : int __pyx_t_2;
16682 155 : int __pyx_t_3;
16683 155 : int __pyx_t_4;
16684 :
16685 : /* "scipy/linalg/_decomp_update.pyx":633
16686 : * cdef blas_t rjj, tau
16687 : * cdef blas_t* work
16688 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
16689 : * cdef char* sideR = 'R'
16690 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16691 : */
16692 155 : __pyx_v_sideL = ((char *)"L");
16693 :
16694 : /* "scipy/linalg/_decomp_update.pyx":634
16695 : * cdef blas_t* work
16696 : * cdef char* sideL = 'L'
16697 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
16698 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16699 : * cdef int limit = min(m, n)
16700 : */
16701 155 : __pyx_v_sideR = ((char *)"R");
16702 :
16703 : /* "scipy/linalg/_decomp_update.pyx":636
16704 : * cdef char* sideR = 'R'
16705 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16706 : * cdef int limit = min(m, n) # <<<<<<<<<<<<<<
16707 : *
16708 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16709 : */
16710 155 : __pyx_t_1 = __pyx_v_n;
16711 155 : __pyx_t_2 = __pyx_v_m;
16712 155 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
16713 155 : if (__pyx_t_4) {
16714 : __pyx_t_3 = __pyx_t_1;
16715 : } else {
16716 : __pyx_t_3 = __pyx_t_2;
16717 : }
16718 155 : __pyx_v_limit = __pyx_t_3;
16719 :
16720 : /* "scipy/linalg/_decomp_update.pyx":638
16721 : * cdef int limit = min(m, n)
16722 : *
16723 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t)) # <<<<<<<<<<<<<<
16724 : * if not work:
16725 : * return MEMORY_ERROR
16726 : */
16727 155 : __pyx_t_3 = __pyx_v_n;
16728 155 : __pyx_t_1 = __pyx_v_m;
16729 155 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
16730 155 : if (__pyx_t_4) {
16731 : __pyx_t_2 = __pyx_t_3;
16732 : } else {
16733 : __pyx_t_2 = __pyx_t_1;
16734 : }
16735 155 : __pyx_v_work = ((__pyx_t_float_complex *)malloc((__pyx_t_2 * (sizeof(__pyx_t_float_complex)))));
16736 :
16737 : /* "scipy/linalg/_decomp_update.pyx":639
16738 : *
16739 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16740 : * if not work: # <<<<<<<<<<<<<<
16741 : * return MEMORY_ERROR
16742 : *
16743 : */
16744 155 : __pyx_t_4 = (!(__pyx_v_work != 0));
16745 155 : if (__pyx_t_4) {
16746 :
16747 : /* "scipy/linalg/_decomp_update.pyx":640
16748 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16749 : * if not work:
16750 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
16751 : *
16752 : * for j in range(limit):
16753 : */
16754 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
16755 0 : goto __pyx_L0;
16756 :
16757 : /* "scipy/linalg/_decomp_update.pyx":639
16758 : *
16759 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
16760 : * if not work: # <<<<<<<<<<<<<<
16761 : * return MEMORY_ERROR
16762 : *
16763 : */
16764 : }
16765 :
16766 : /* "scipy/linalg/_decomp_update.pyx":642
16767 : * return MEMORY_ERROR
16768 : *
16769 : * for j in range(limit): # <<<<<<<<<<<<<<
16770 : * rjj = index2(r, rs, j, j)[0]
16771 : * hlen = m-j
16772 : */
16773 1409 : __pyx_t_2 = __pyx_v_limit;
16774 1409 : __pyx_t_3 = __pyx_t_2;
16775 1409 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
16776 1254 : __pyx_v_j = __pyx_t_1;
16777 :
16778 : /* "scipy/linalg/_decomp_update.pyx":643
16779 : *
16780 : * for j in range(limit):
16781 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
16782 : * hlen = m-j
16783 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16784 : */
16785 1254 : __pyx_v_rjj = (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
16786 :
16787 : /* "scipy/linalg/_decomp_update.pyx":644
16788 : * for j in range(limit):
16789 : * rjj = index2(r, rs, j, j)[0]
16790 : * hlen = m-j # <<<<<<<<<<<<<<
16791 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16792 : * index2(r, rs, j, j)[0] = 1
16793 : */
16794 1254 : __pyx_v_hlen = (__pyx_v_m - __pyx_v_j);
16795 :
16796 : /* "scipy/linalg/_decomp_update.pyx":645
16797 : * rjj = index2(r, rs, j, j)[0]
16798 : * hlen = m-j
16799 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
16800 : * index2(r, rs, j, j)[0] = 1
16801 : * if j+1 < n:
16802 : */
16803 1254 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_hlen, (&__pyx_v_rjj), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
16804 :
16805 : /* "scipy/linalg/_decomp_update.pyx":646
16806 : * hlen = m-j
16807 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16808 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
16809 : * if j+1 < n:
16810 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16811 : */
16812 1254 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_t_float_complex_from_parts(1, 0);
16813 :
16814 : /* "scipy/linalg/_decomp_update.pyx":647
16815 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16816 : * index2(r, rs, j, j)[0] = 1
16817 : * if j+1 < n: # <<<<<<<<<<<<<<
16818 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16819 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16820 : */
16821 1254 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
16822 1254 : if (__pyx_t_4) {
16823 :
16824 : /* "scipy/linalg/_decomp_update.pyx":648
16825 : * index2(r, rs, j, j)[0] = 1
16826 : * if j+1 < n:
16827 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
16828 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16829 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
16830 : */
16831 1141 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_hlen, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __Pyx_c_conj_float(__pyx_v_tau), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
16832 :
16833 : /* "scipy/linalg/_decomp_update.pyx":647
16834 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
16835 : * index2(r, rs, j, j)[0] = 1
16836 : * if j+1 < n: # <<<<<<<<<<<<<<
16837 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16838 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16839 : */
16840 : }
16841 :
16842 : /* "scipy/linalg/_decomp_update.pyx":650
16843 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
16844 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
16845 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
16846 : * index2(q, qs, 0, j), qs[1], work)
16847 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
16848 : */
16849 1254 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_hlen, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
16850 :
16851 : /* "scipy/linalg/_decomp_update.pyx":652
16852 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
16853 : * index2(q, qs, 0, j), qs[1], work)
16854 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t)) # <<<<<<<<<<<<<<
16855 : * index2(r, rs, j, j)[0] = rjj
16856 : *
16857 : */
16858 1254 : (void)(memset(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), 0, (__pyx_v_hlen * (sizeof(__pyx_t_float_complex)))));
16859 :
16860 : /* "scipy/linalg/_decomp_update.pyx":653
16861 : * index2(q, qs, 0, j), qs[1], work)
16862 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
16863 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
16864 : *
16865 : * # permute the rows., work columnwise, since q is fortran order
16866 : */
16867 1254 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
16868 : }
16869 :
16870 : /* "scipy/linalg/_decomp_update.pyx":656
16871 : *
16872 : * # permute the rows., work columnwise, since q is fortran order
16873 : * if k != m-p: # <<<<<<<<<<<<<<
16874 : * for j in range(m):
16875 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16876 : */
16877 155 : __pyx_t_4 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
16878 155 : if (__pyx_t_4) {
16879 :
16880 : /* "scipy/linalg/_decomp_update.pyx":657
16881 : * # permute the rows., work columnwise, since q is fortran order
16882 : * if k != m-p:
16883 : * for j in range(m): # <<<<<<<<<<<<<<
16884 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16885 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16886 : */
16887 1915 : __pyx_t_2 = __pyx_v_m;
16888 1915 : __pyx_t_3 = __pyx_t_2;
16889 1915 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
16890 1768 : __pyx_v_j = __pyx_t_1;
16891 :
16892 : /* "scipy/linalg/_decomp_update.pyx":658
16893 : * if k != m-p:
16894 : * for j in range(m):
16895 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
16896 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16897 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16898 : */
16899 1768 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
16900 :
16901 : /* "scipy/linalg/_decomp_update.pyx":659
16902 : * for j in range(m):
16903 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16904 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
16905 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16906 : *
16907 : */
16908 1768 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
16909 :
16910 : /* "scipy/linalg/_decomp_update.pyx":660
16911 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16912 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
16913 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
16914 : *
16915 : * libc.stdlib.free(work)
16916 : */
16917 1768 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
16918 : }
16919 :
16920 : /* "scipy/linalg/_decomp_update.pyx":656
16921 : *
16922 : * # permute the rows., work columnwise, since q is fortran order
16923 : * if k != m-p: # <<<<<<<<<<<<<<
16924 : * for j in range(m):
16925 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
16926 : */
16927 : }
16928 :
16929 : /* "scipy/linalg/_decomp_update.pyx":662
16930 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
16931 : *
16932 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
16933 : * return 0
16934 : *
16935 : */
16936 155 : free(__pyx_v_work);
16937 :
16938 : /* "scipy/linalg/_decomp_update.pyx":663
16939 : *
16940 : * libc.stdlib.free(work)
16941 : * return 0 # <<<<<<<<<<<<<<
16942 : *
16943 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
16944 : */
16945 155 : __pyx_r = 0;
16946 155 : goto __pyx_L0;
16947 :
16948 : /* "scipy/linalg/_decomp_update.pyx":614
16949 : * libc.stdlib.free(work)
16950 : *
16951 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
16952 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
16953 : * # this should someday call lapack's xtpqrt (requires lapack >= 3.4
16954 : */
16955 :
16956 : /* function exit code */
16957 155 : __pyx_L0:;
16958 155 : return __pyx_r;
16959 : }
16960 :
16961 155 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
16962 155 : int __pyx_v_j;
16963 155 : int __pyx_v_hlen;
16964 155 : __pyx_t_double_complex __pyx_v_rjj;
16965 155 : __pyx_t_double_complex __pyx_v_tau;
16966 155 : __pyx_t_double_complex *__pyx_v_work;
16967 155 : char *__pyx_v_sideL;
16968 155 : char *__pyx_v_sideR;
16969 155 : int __pyx_v_limit;
16970 155 : int __pyx_r;
16971 155 : int __pyx_t_1;
16972 155 : int __pyx_t_2;
16973 155 : int __pyx_t_3;
16974 155 : int __pyx_t_4;
16975 :
16976 : /* "scipy/linalg/_decomp_update.pyx":633
16977 : * cdef blas_t rjj, tau
16978 : * cdef blas_t* work
16979 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
16980 : * cdef char* sideR = 'R'
16981 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16982 : */
16983 155 : __pyx_v_sideL = ((char *)"L");
16984 :
16985 : /* "scipy/linalg/_decomp_update.pyx":634
16986 : * cdef blas_t* work
16987 : * cdef char* sideL = 'L'
16988 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
16989 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16990 : * cdef int limit = min(m, n)
16991 : */
16992 155 : __pyx_v_sideR = ((char *)"R");
16993 :
16994 : /* "scipy/linalg/_decomp_update.pyx":636
16995 : * cdef char* sideR = 'R'
16996 : * # for tall or sqr + rows should be n. for fat + rows should be new m
16997 : * cdef int limit = min(m, n) # <<<<<<<<<<<<<<
16998 : *
16999 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
17000 : */
17001 155 : __pyx_t_1 = __pyx_v_n;
17002 155 : __pyx_t_2 = __pyx_v_m;
17003 155 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
17004 155 : if (__pyx_t_4) {
17005 : __pyx_t_3 = __pyx_t_1;
17006 : } else {
17007 : __pyx_t_3 = __pyx_t_2;
17008 : }
17009 155 : __pyx_v_limit = __pyx_t_3;
17010 :
17011 : /* "scipy/linalg/_decomp_update.pyx":638
17012 : * cdef int limit = min(m, n)
17013 : *
17014 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t)) # <<<<<<<<<<<<<<
17015 : * if not work:
17016 : * return MEMORY_ERROR
17017 : */
17018 155 : __pyx_t_3 = __pyx_v_n;
17019 155 : __pyx_t_1 = __pyx_v_m;
17020 155 : __pyx_t_4 = (__pyx_t_3 > __pyx_t_1);
17021 155 : if (__pyx_t_4) {
17022 : __pyx_t_2 = __pyx_t_3;
17023 : } else {
17024 : __pyx_t_2 = __pyx_t_1;
17025 : }
17026 155 : __pyx_v_work = ((__pyx_t_double_complex *)malloc((__pyx_t_2 * (sizeof(__pyx_t_double_complex)))));
17027 :
17028 : /* "scipy/linalg/_decomp_update.pyx":639
17029 : *
17030 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
17031 : * if not work: # <<<<<<<<<<<<<<
17032 : * return MEMORY_ERROR
17033 : *
17034 : */
17035 155 : __pyx_t_4 = (!(__pyx_v_work != 0));
17036 155 : if (__pyx_t_4) {
17037 :
17038 : /* "scipy/linalg/_decomp_update.pyx":640
17039 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
17040 : * if not work:
17041 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
17042 : *
17043 : * for j in range(limit):
17044 : */
17045 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
17046 0 : goto __pyx_L0;
17047 :
17048 : /* "scipy/linalg/_decomp_update.pyx":639
17049 : *
17050 : * work = <blas_t*>libc.stdlib.malloc(max(m,n)*sizeof(blas_t))
17051 : * if not work: # <<<<<<<<<<<<<<
17052 : * return MEMORY_ERROR
17053 : *
17054 : */
17055 : }
17056 :
17057 : /* "scipy/linalg/_decomp_update.pyx":642
17058 : * return MEMORY_ERROR
17059 : *
17060 : * for j in range(limit): # <<<<<<<<<<<<<<
17061 : * rjj = index2(r, rs, j, j)[0]
17062 : * hlen = m-j
17063 : */
17064 1409 : __pyx_t_2 = __pyx_v_limit;
17065 1409 : __pyx_t_3 = __pyx_t_2;
17066 1409 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
17067 1254 : __pyx_v_j = __pyx_t_1;
17068 :
17069 : /* "scipy/linalg/_decomp_update.pyx":643
17070 : *
17071 : * for j in range(limit):
17072 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
17073 : * hlen = m-j
17074 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
17075 : */
17076 1254 : __pyx_v_rjj = (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
17077 :
17078 : /* "scipy/linalg/_decomp_update.pyx":644
17079 : * for j in range(limit):
17080 : * rjj = index2(r, rs, j, j)[0]
17081 : * hlen = m-j # <<<<<<<<<<<<<<
17082 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
17083 : * index2(r, rs, j, j)[0] = 1
17084 : */
17085 1254 : __pyx_v_hlen = (__pyx_v_m - __pyx_v_j);
17086 :
17087 : /* "scipy/linalg/_decomp_update.pyx":645
17088 : * rjj = index2(r, rs, j, j)[0]
17089 : * hlen = m-j
17090 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
17091 : * index2(r, rs, j, j)[0] = 1
17092 : * if j+1 < n:
17093 : */
17094 1254 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_hlen, (&__pyx_v_rjj), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
17095 :
17096 : /* "scipy/linalg/_decomp_update.pyx":646
17097 : * hlen = m-j
17098 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
17099 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
17100 : * if j+1 < n:
17101 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
17102 : */
17103 1254 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_t_double_complex_from_parts(1, 0);
17104 :
17105 : /* "scipy/linalg/_decomp_update.pyx":647
17106 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
17107 : * index2(r, rs, j, j)[0] = 1
17108 : * if j+1 < n: # <<<<<<<<<<<<<<
17109 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
17110 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
17111 : */
17112 1254 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
17113 1254 : if (__pyx_t_4) {
17114 :
17115 : /* "scipy/linalg/_decomp_update.pyx":648
17116 : * index2(r, rs, j, j)[0] = 1
17117 : * if j+1 < n:
17118 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
17119 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
17120 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
17121 : */
17122 1141 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_hlen, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __Pyx_c_conj_double(__pyx_v_tau), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
17123 :
17124 : /* "scipy/linalg/_decomp_update.pyx":647
17125 : * larfg(hlen, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
17126 : * index2(r, rs, j, j)[0] = 1
17127 : * if j+1 < n: # <<<<<<<<<<<<<<
17128 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
17129 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
17130 : */
17131 : }
17132 :
17133 : /* "scipy/linalg/_decomp_update.pyx":650
17134 : * larf(sideL, hlen, n-j-1, index2(r, rs, j, j), rs[0],
17135 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
17136 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
17137 : * index2(q, qs, 0, j), qs[1], work)
17138 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
17139 : */
17140 1254 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_hlen, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
17141 :
17142 : /* "scipy/linalg/_decomp_update.pyx":652
17143 : * larf(sideR, m, hlen, index2(r, rs, j, j), rs[0], tau,
17144 : * index2(q, qs, 0, j), qs[1], work)
17145 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t)) # <<<<<<<<<<<<<<
17146 : * index2(r, rs, j, j)[0] = rjj
17147 : *
17148 : */
17149 1254 : (void)(memset(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), 0, (__pyx_v_hlen * (sizeof(__pyx_t_double_complex)))));
17150 :
17151 : /* "scipy/linalg/_decomp_update.pyx":653
17152 : * index2(q, qs, 0, j), qs[1], work)
17153 : * memset(index2(r, rs, j, j), 0, hlen*sizeof(blas_t))
17154 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
17155 : *
17156 : * # permute the rows., work columnwise, since q is fortran order
17157 : */
17158 1254 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
17159 : }
17160 :
17161 : /* "scipy/linalg/_decomp_update.pyx":656
17162 : *
17163 : * # permute the rows., work columnwise, since q is fortran order
17164 : * if k != m-p: # <<<<<<<<<<<<<<
17165 : * for j in range(m):
17166 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
17167 : */
17168 155 : __pyx_t_4 = (__pyx_v_k != (__pyx_v_m - __pyx_v_p));
17169 155 : if (__pyx_t_4) {
17170 :
17171 : /* "scipy/linalg/_decomp_update.pyx":657
17172 : * # permute the rows., work columnwise, since q is fortran order
17173 : * if k != m-p:
17174 : * for j in range(m): # <<<<<<<<<<<<<<
17175 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
17176 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
17177 : */
17178 1915 : __pyx_t_2 = __pyx_v_m;
17179 1915 : __pyx_t_3 = __pyx_t_2;
17180 1915 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
17181 1768 : __pyx_v_j = __pyx_t_1;
17182 :
17183 : /* "scipy/linalg/_decomp_update.pyx":658
17184 : * if k != m-p:
17185 : * for j in range(m):
17186 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1) # <<<<<<<<<<<<<<
17187 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
17188 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
17189 : */
17190 1768 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy((__pyx_v_m - __pyx_v_k), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]), __pyx_v_work, 1);
17191 :
17192 : /* "scipy/linalg/_decomp_update.pyx":659
17193 : * for j in range(m):
17194 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
17195 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0]) # <<<<<<<<<<<<<<
17196 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
17197 : *
17198 : */
17199 1768 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_p, (__pyx_v_work + ((__pyx_v_m - __pyx_v_k) - __pyx_v_p)), 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, __pyx_v_k, __pyx_v_j), (__pyx_v_qs[0]));
17200 :
17201 : /* "scipy/linalg/_decomp_update.pyx":660
17202 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
17203 : * copy(p, work+(m-k-p), 1, index2(q, qs, k, j), qs[0])
17204 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0]) # <<<<<<<<<<<<<<
17205 : *
17206 : * libc.stdlib.free(work)
17207 : */
17208 1768 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_m - __pyx_v_k) - __pyx_v_p), __pyx_v_work, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, (__pyx_v_k + __pyx_v_p), __pyx_v_j), (__pyx_v_qs[0]));
17209 : }
17210 :
17211 : /* "scipy/linalg/_decomp_update.pyx":656
17212 : *
17213 : * # permute the rows., work columnwise, since q is fortran order
17214 : * if k != m-p: # <<<<<<<<<<<<<<
17215 : * for j in range(m):
17216 : * copy(m-k, index2(q, qs, k, j), qs[0], work, 1)
17217 : */
17218 : }
17219 :
17220 : /* "scipy/linalg/_decomp_update.pyx":662
17221 : * copy(m-k-p, work, 1, index2(q, qs, k+p, j), qs[0])
17222 : *
17223 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
17224 : * return 0
17225 : *
17226 : */
17227 155 : free(__pyx_v_work);
17228 :
17229 : /* "scipy/linalg/_decomp_update.pyx":663
17230 : *
17231 : * libc.stdlib.free(work)
17232 : * return 0 # <<<<<<<<<<<<<<
17233 : *
17234 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r,
17235 : */
17236 155 : __pyx_r = 0;
17237 155 : goto __pyx_L0;
17238 :
17239 : /* "scipy/linalg/_decomp_update.pyx":614
17240 : * libc.stdlib.free(work)
17241 : *
17242 : * cdef int qr_block_row_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
17243 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
17244 : * # this should someday call lapack's xtpqrt (requires lapack >= 3.4
17245 : */
17246 :
17247 : /* function exit code */
17248 155 : __pyx_L0:;
17249 155 : return __pyx_r;
17250 : }
17251 :
17252 : /* "scipy/linalg/_decomp_update.pyx":665
17253 : * return 0
17254 : *
17255 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
17256 : * int* rs, blas_t* u, int* us, int k, int p_eco,
17257 : * int p_full, blas_t* rcond) noexcept nogil:
17258 : */
17259 :
17260 37 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, float *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full, float *__pyx_v_rcond) {
17261 37 : int __pyx_v_i;
17262 37 : int __pyx_v_j;
17263 37 : int __pyx_v_info;
17264 37 : float __pyx_v_c;
17265 37 : float __pyx_v_sn;
17266 37 : CYTHON_UNUSED float __pyx_v_rc0;
17267 37 : float __pyx_v_rc;
17268 37 : float *__pyx_v_s;
17269 37 : char *__pyx_v_N;
17270 37 : char *__pyx_v_T;
17271 37 : CYTHON_UNUSED char *__pyx_v_C;
17272 37 : char *__pyx_v_TC;
17273 37 : int __pyx_r;
17274 37 : int __pyx_t_1;
17275 37 : int __pyx_t_2;
17276 37 : int __pyx_t_3;
17277 37 : int __pyx_t_4;
17278 37 : long __pyx_t_5;
17279 37 : long __pyx_t_6;
17280 37 : int __pyx_t_7;
17281 :
17282 : /* "scipy/linalg/_decomp_update.pyx":673
17283 : * cdef blas_t rc0, rc;
17284 : * cdef blas_t* s
17285 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
17286 : * cdef char* T = 'T'
17287 : * cdef char* C = 'C'
17288 : */
17289 37 : __pyx_v_N = ((char *)"N");
17290 :
17291 : /* "scipy/linalg/_decomp_update.pyx":674
17292 : * cdef blas_t* s
17293 : * cdef char* N = 'N'
17294 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
17295 : * cdef char* C = 'C'
17296 : * cdef char* TC
17297 : */
17298 37 : __pyx_v_T = ((char *)"T");
17299 :
17300 : /* "scipy/linalg/_decomp_update.pyx":675
17301 : * cdef char* N = 'N'
17302 : * cdef char* T = 'T'
17303 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
17304 : * cdef char* TC
17305 : *
17306 : */
17307 37 : __pyx_v_C = ((char *)"C");
17308 :
17309 : /* "scipy/linalg/_decomp_update.pyx":679
17310 : *
17311 : * if blas_t is float or blas_t is double:
17312 : * TC = T # <<<<<<<<<<<<<<
17313 : * rc0 = rcond[0]
17314 : * elif blas_t is float_complex:
17315 : */
17316 37 : __pyx_v_TC = __pyx_v_T;
17317 :
17318 : /* "scipy/linalg/_decomp_update.pyx":680
17319 : * if blas_t is float or blas_t is double:
17320 : * TC = T
17321 : * rc0 = rcond[0] # <<<<<<<<<<<<<<
17322 : * elif blas_t is float_complex:
17323 : * TC = C
17324 : */
17325 37 : __pyx_v_rc0 = (__pyx_v_rcond[0]);
17326 :
17327 : /* "scipy/linalg/_decomp_update.pyx":694
17328 : * # original system, not the new system.
17329 : *
17330 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t)) # <<<<<<<<<<<<<<
17331 : * if not s:
17332 : * return MEMORY_ERROR
17333 : */
17334 37 : __pyx_v_s = ((float *)malloc(((2 * (__pyx_v_n + __pyx_v_p_eco)) * (sizeof(float)))));
17335 :
17336 : /* "scipy/linalg/_decomp_update.pyx":695
17337 : *
17338 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17339 : * if not s: # <<<<<<<<<<<<<<
17340 : * return MEMORY_ERROR
17341 : *
17342 : */
17343 37 : __pyx_t_1 = (!(__pyx_v_s != 0));
17344 37 : if (__pyx_t_1) {
17345 :
17346 : /* "scipy/linalg/_decomp_update.pyx":696
17347 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17348 : * if not s:
17349 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
17350 : *
17351 : * for j in range(p_eco):
17352 : */
17353 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
17354 0 : goto __pyx_L0;
17355 :
17356 : /* "scipy/linalg/_decomp_update.pyx":695
17357 : *
17358 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17359 : * if not s: # <<<<<<<<<<<<<<
17360 : * return MEMORY_ERROR
17361 : *
17362 : */
17363 : }
17364 :
17365 : /* "scipy/linalg/_decomp_update.pyx":698
17366 : * return MEMORY_ERROR
17367 : *
17368 : * for j in range(p_eco): # <<<<<<<<<<<<<<
17369 : * rc = rcond[0]
17370 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17371 : */
17372 : __pyx_t_2 = __pyx_v_p_eco;
17373 : __pyx_t_3 = __pyx_t_2;
17374 157 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17375 121 : __pyx_v_j = __pyx_t_4;
17376 :
17377 : /* "scipy/linalg/_decomp_update.pyx":699
17378 : *
17379 : * for j in range(p_eco):
17380 : * rc = rcond[0] # <<<<<<<<<<<<<<
17381 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17382 : * if info == 2:
17383 : */
17384 121 : __pyx_v_rc = (__pyx_v_rcond[0]);
17385 :
17386 : /* "scipy/linalg/_decomp_update.pyx":700
17387 : * for j in range(p_eco):
17388 : * rc = rcond[0]
17389 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc) # <<<<<<<<<<<<<<
17390 : * if info == 2:
17391 : * if blas_t is float or blas_t is double:
17392 : */
17393 121 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, (__pyx_v_n + __pyx_v_j), __pyx_v_q, __pyx_v_qs, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_v_s, (&__pyx_v_rc));
17394 :
17395 : /* "scipy/linalg/_decomp_update.pyx":701
17396 : * rc = rcond[0]
17397 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17398 : * if info == 2: # <<<<<<<<<<<<<<
17399 : * if blas_t is float or blas_t is double:
17400 : * rcond[0] = rc;
17401 : */
17402 121 : __pyx_t_1 = (__pyx_v_info == 2);
17403 121 : if (__pyx_t_1) {
17404 :
17405 : /* "scipy/linalg/_decomp_update.pyx":703
17406 : * if info == 2:
17407 : * if blas_t is float or blas_t is double:
17408 : * rcond[0] = rc; # <<<<<<<<<<<<<<
17409 : * elif blas_t is float_complex:
17410 : * rcond[0] = (<float*>&rc)[0]
17411 : */
17412 1 : (__pyx_v_rcond[0]) = __pyx_v_rc;
17413 :
17414 : /* "scipy/linalg/_decomp_update.pyx":708
17415 : * else:
17416 : * rcond[0] = (<double*>&rc)[0]
17417 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
17418 : * return info
17419 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
17420 : */
17421 1 : free(__pyx_v_s);
17422 :
17423 : /* "scipy/linalg/_decomp_update.pyx":709
17424 : * rcond[0] = (<double*>&rc)[0]
17425 : * libc.stdlib.free(s)
17426 : * return info # <<<<<<<<<<<<<<
17427 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
17428 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
17429 : */
17430 1 : __pyx_r = __pyx_v_info;
17431 1 : goto __pyx_L0;
17432 :
17433 : /* "scipy/linalg/_decomp_update.pyx":701
17434 : * rc = rcond[0]
17435 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17436 : * if info == 2: # <<<<<<<<<<<<<<
17437 : * if blas_t is float or blas_t is double:
17438 : * rcond[0] = rc;
17439 : */
17440 : }
17441 :
17442 : /* "scipy/linalg/_decomp_update.pyx":710
17443 : * libc.stdlib.free(s)
17444 : * return info
17445 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0]) # <<<<<<<<<<<<<<
17446 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
17447 : *
17448 : */
17449 120 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n + __pyx_v_j)), (__pyx_v_qs[0]));
17450 :
17451 : /* "scipy/linalg/_decomp_update.pyx":711
17452 : * return info
17453 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
17454 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0]) # <<<<<<<<<<<<<<
17455 : *
17456 : * for i in range(n-2+1, k-1, -1):
17457 : */
17458 120 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n + __pyx_v_j) + 1), __pyx_v_s, 1, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_j)), (__pyx_v_rs[0]));
17459 :
17460 : /* "scipy/linalg/_decomp_update.pyx":713
17461 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
17462 : *
17463 : * for i in range(n-2+1, k-1, -1): # <<<<<<<<<<<<<<
17464 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
17465 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
17466 : */
17467 120 : __pyx_t_5 = (__pyx_v_k - 1);
17468 120 : __pyx_t_6 = __pyx_t_5;
17469 516 : for (__pyx_t_7 = ((__pyx_v_n - 2) + 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
17470 396 : __pyx_v_i = __pyx_t_7;
17471 :
17472 : /* "scipy/linalg/_decomp_update.pyx":714
17473 : *
17474 : * for i in range(n-2+1, k-1, -1):
17475 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn) # <<<<<<<<<<<<<<
17476 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
17477 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
17478 : */
17479 396 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), (__pyx_v_k + __pyx_v_j)), (&__pyx_v_c), (&__pyx_v_sn));
17480 :
17481 : /* "scipy/linalg/_decomp_update.pyx":715
17482 : * for i in range(n-2+1, k-1, -1):
17483 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
17484 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1], # <<<<<<<<<<<<<<
17485 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
17486 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
17487 : */
17488 396 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_i), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
17489 :
17490 : /* "scipy/linalg/_decomp_update.pyx":717
17491 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
17492 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
17493 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0], # <<<<<<<<<<<<<<
17494 : * c, sn.conjugate())
17495 : * libc.stdlib.free(s)
17496 : */
17497 396 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_i + __pyx_v_j)), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, ((__pyx_v_i + __pyx_v_j) + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
17498 : }
17499 : }
17500 :
17501 : /* "scipy/linalg/_decomp_update.pyx":719
17502 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
17503 : * c, sn.conjugate())
17504 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
17505 : *
17506 : * if p_full > 0:
17507 : */
17508 36 : free(__pyx_v_s);
17509 :
17510 : /* "scipy/linalg/_decomp_update.pyx":721
17511 : * libc.stdlib.free(s)
17512 : *
17513 : * if p_full > 0: # <<<<<<<<<<<<<<
17514 : * # if this is true, we have ensured the u is also F contiguous.
17515 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
17516 : */
17517 36 : __pyx_t_1 = (__pyx_v_p_full > 0);
17518 36 : if (__pyx_t_1) {
17519 :
17520 : /* "scipy/linalg/_decomp_update.pyx":723
17521 : * if p_full > 0:
17522 : * # if this is true, we have ensured the u is also F contiguous.
17523 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0, # <<<<<<<<<<<<<<
17524 : * col(r, rs, k+p_eco), m)
17525 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
17526 : */
17527 8 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_TC, __pyx_v_N, __pyx_v_m, __pyx_v_p_full, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_p_eco), __pyx_v_m, 0.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco)), __pyx_v_m);
17528 :
17529 : /* "scipy/linalg/_decomp_update.pyx":725
17530 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
17531 : * col(r, rs, k+p_eco), m)
17532 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full) # <<<<<<<<<<<<<<
17533 : *
17534 : * return 0
17535 : */
17536 8 : (void)(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, ((__pyx_v_n + __pyx_v_p_eco) + __pyx_v_p_full), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco), __pyx_v_p_full));
17537 :
17538 : /* "scipy/linalg/_decomp_update.pyx":721
17539 : * libc.stdlib.free(s)
17540 : *
17541 : * if p_full > 0: # <<<<<<<<<<<<<<
17542 : * # if this is true, we have ensured the u is also F contiguous.
17543 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
17544 : */
17545 : }
17546 :
17547 : /* "scipy/linalg/_decomp_update.pyx":727
17548 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
17549 : *
17550 : * return 0 # <<<<<<<<<<<<<<
17551 : *
17552 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
17553 : */
17554 36 : __pyx_r = 0;
17555 36 : goto __pyx_L0;
17556 :
17557 : /* "scipy/linalg/_decomp_update.pyx":665
17558 : * return 0
17559 : *
17560 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
17561 : * int* rs, blas_t* u, int* us, int k, int p_eco,
17562 : * int p_full, blas_t* rcond) noexcept nogil:
17563 : */
17564 :
17565 : /* function exit code */
17566 37 : __pyx_L0:;
17567 37 : return __pyx_r;
17568 : }
17569 :
17570 37 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, double *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full, double *__pyx_v_rcond) {
17571 37 : int __pyx_v_i;
17572 37 : int __pyx_v_j;
17573 37 : int __pyx_v_info;
17574 37 : double __pyx_v_c;
17575 37 : double __pyx_v_sn;
17576 37 : CYTHON_UNUSED double __pyx_v_rc0;
17577 37 : double __pyx_v_rc;
17578 37 : double *__pyx_v_s;
17579 37 : char *__pyx_v_N;
17580 37 : char *__pyx_v_T;
17581 37 : CYTHON_UNUSED char *__pyx_v_C;
17582 37 : char *__pyx_v_TC;
17583 37 : int __pyx_r;
17584 37 : int __pyx_t_1;
17585 37 : int __pyx_t_2;
17586 37 : int __pyx_t_3;
17587 37 : int __pyx_t_4;
17588 37 : long __pyx_t_5;
17589 37 : long __pyx_t_6;
17590 37 : int __pyx_t_7;
17591 :
17592 : /* "scipy/linalg/_decomp_update.pyx":673
17593 : * cdef blas_t rc0, rc;
17594 : * cdef blas_t* s
17595 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
17596 : * cdef char* T = 'T'
17597 : * cdef char* C = 'C'
17598 : */
17599 37 : __pyx_v_N = ((char *)"N");
17600 :
17601 : /* "scipy/linalg/_decomp_update.pyx":674
17602 : * cdef blas_t* s
17603 : * cdef char* N = 'N'
17604 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
17605 : * cdef char* C = 'C'
17606 : * cdef char* TC
17607 : */
17608 37 : __pyx_v_T = ((char *)"T");
17609 :
17610 : /* "scipy/linalg/_decomp_update.pyx":675
17611 : * cdef char* N = 'N'
17612 : * cdef char* T = 'T'
17613 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
17614 : * cdef char* TC
17615 : *
17616 : */
17617 37 : __pyx_v_C = ((char *)"C");
17618 :
17619 : /* "scipy/linalg/_decomp_update.pyx":679
17620 : *
17621 : * if blas_t is float or blas_t is double:
17622 : * TC = T # <<<<<<<<<<<<<<
17623 : * rc0 = rcond[0]
17624 : * elif blas_t is float_complex:
17625 : */
17626 37 : __pyx_v_TC = __pyx_v_T;
17627 :
17628 : /* "scipy/linalg/_decomp_update.pyx":680
17629 : * if blas_t is float or blas_t is double:
17630 : * TC = T
17631 : * rc0 = rcond[0] # <<<<<<<<<<<<<<
17632 : * elif blas_t is float_complex:
17633 : * TC = C
17634 : */
17635 37 : __pyx_v_rc0 = (__pyx_v_rcond[0]);
17636 :
17637 : /* "scipy/linalg/_decomp_update.pyx":694
17638 : * # original system, not the new system.
17639 : *
17640 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t)) # <<<<<<<<<<<<<<
17641 : * if not s:
17642 : * return MEMORY_ERROR
17643 : */
17644 37 : __pyx_v_s = ((double *)malloc(((2 * (__pyx_v_n + __pyx_v_p_eco)) * (sizeof(double)))));
17645 :
17646 : /* "scipy/linalg/_decomp_update.pyx":695
17647 : *
17648 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17649 : * if not s: # <<<<<<<<<<<<<<
17650 : * return MEMORY_ERROR
17651 : *
17652 : */
17653 37 : __pyx_t_1 = (!(__pyx_v_s != 0));
17654 37 : if (__pyx_t_1) {
17655 :
17656 : /* "scipy/linalg/_decomp_update.pyx":696
17657 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17658 : * if not s:
17659 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
17660 : *
17661 : * for j in range(p_eco):
17662 : */
17663 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
17664 0 : goto __pyx_L0;
17665 :
17666 : /* "scipy/linalg/_decomp_update.pyx":695
17667 : *
17668 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17669 : * if not s: # <<<<<<<<<<<<<<
17670 : * return MEMORY_ERROR
17671 : *
17672 : */
17673 : }
17674 :
17675 : /* "scipy/linalg/_decomp_update.pyx":698
17676 : * return MEMORY_ERROR
17677 : *
17678 : * for j in range(p_eco): # <<<<<<<<<<<<<<
17679 : * rc = rcond[0]
17680 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17681 : */
17682 : __pyx_t_2 = __pyx_v_p_eco;
17683 : __pyx_t_3 = __pyx_t_2;
17684 157 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17685 121 : __pyx_v_j = __pyx_t_4;
17686 :
17687 : /* "scipy/linalg/_decomp_update.pyx":699
17688 : *
17689 : * for j in range(p_eco):
17690 : * rc = rcond[0] # <<<<<<<<<<<<<<
17691 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17692 : * if info == 2:
17693 : */
17694 121 : __pyx_v_rc = (__pyx_v_rcond[0]);
17695 :
17696 : /* "scipy/linalg/_decomp_update.pyx":700
17697 : * for j in range(p_eco):
17698 : * rc = rcond[0]
17699 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc) # <<<<<<<<<<<<<<
17700 : * if info == 2:
17701 : * if blas_t is float or blas_t is double:
17702 : */
17703 121 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, (__pyx_v_n + __pyx_v_j), __pyx_v_q, __pyx_v_qs, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_v_s, (&__pyx_v_rc));
17704 :
17705 : /* "scipy/linalg/_decomp_update.pyx":701
17706 : * rc = rcond[0]
17707 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17708 : * if info == 2: # <<<<<<<<<<<<<<
17709 : * if blas_t is float or blas_t is double:
17710 : * rcond[0] = rc;
17711 : */
17712 121 : __pyx_t_1 = (__pyx_v_info == 2);
17713 121 : if (__pyx_t_1) {
17714 :
17715 : /* "scipy/linalg/_decomp_update.pyx":703
17716 : * if info == 2:
17717 : * if blas_t is float or blas_t is double:
17718 : * rcond[0] = rc; # <<<<<<<<<<<<<<
17719 : * elif blas_t is float_complex:
17720 : * rcond[0] = (<float*>&rc)[0]
17721 : */
17722 1 : (__pyx_v_rcond[0]) = __pyx_v_rc;
17723 :
17724 : /* "scipy/linalg/_decomp_update.pyx":708
17725 : * else:
17726 : * rcond[0] = (<double*>&rc)[0]
17727 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
17728 : * return info
17729 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
17730 : */
17731 1 : free(__pyx_v_s);
17732 :
17733 : /* "scipy/linalg/_decomp_update.pyx":709
17734 : * rcond[0] = (<double*>&rc)[0]
17735 : * libc.stdlib.free(s)
17736 : * return info # <<<<<<<<<<<<<<
17737 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
17738 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
17739 : */
17740 1 : __pyx_r = __pyx_v_info;
17741 1 : goto __pyx_L0;
17742 :
17743 : /* "scipy/linalg/_decomp_update.pyx":701
17744 : * rc = rcond[0]
17745 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17746 : * if info == 2: # <<<<<<<<<<<<<<
17747 : * if blas_t is float or blas_t is double:
17748 : * rcond[0] = rc;
17749 : */
17750 : }
17751 :
17752 : /* "scipy/linalg/_decomp_update.pyx":710
17753 : * libc.stdlib.free(s)
17754 : * return info
17755 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0]) # <<<<<<<<<<<<<<
17756 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
17757 : *
17758 : */
17759 120 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n + __pyx_v_j)), (__pyx_v_qs[0]));
17760 :
17761 : /* "scipy/linalg/_decomp_update.pyx":711
17762 : * return info
17763 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
17764 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0]) # <<<<<<<<<<<<<<
17765 : *
17766 : * for i in range(n-2+1, k-1, -1):
17767 : */
17768 120 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n + __pyx_v_j) + 1), __pyx_v_s, 1, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_j)), (__pyx_v_rs[0]));
17769 :
17770 : /* "scipy/linalg/_decomp_update.pyx":713
17771 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
17772 : *
17773 : * for i in range(n-2+1, k-1, -1): # <<<<<<<<<<<<<<
17774 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
17775 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
17776 : */
17777 120 : __pyx_t_5 = (__pyx_v_k - 1);
17778 120 : __pyx_t_6 = __pyx_t_5;
17779 516 : for (__pyx_t_7 = ((__pyx_v_n - 2) + 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
17780 396 : __pyx_v_i = __pyx_t_7;
17781 :
17782 : /* "scipy/linalg/_decomp_update.pyx":714
17783 : *
17784 : * for i in range(n-2+1, k-1, -1):
17785 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn) # <<<<<<<<<<<<<<
17786 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
17787 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
17788 : */
17789 396 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), (__pyx_v_k + __pyx_v_j)), (&__pyx_v_c), (&__pyx_v_sn));
17790 :
17791 : /* "scipy/linalg/_decomp_update.pyx":715
17792 : * for i in range(n-2+1, k-1, -1):
17793 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
17794 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1], # <<<<<<<<<<<<<<
17795 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
17796 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
17797 : */
17798 396 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_i), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
17799 :
17800 : /* "scipy/linalg/_decomp_update.pyx":717
17801 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
17802 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
17803 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0], # <<<<<<<<<<<<<<
17804 : * c, sn.conjugate())
17805 : * libc.stdlib.free(s)
17806 : */
17807 396 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_i + __pyx_v_j)), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, ((__pyx_v_i + __pyx_v_j) + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
17808 : }
17809 : }
17810 :
17811 : /* "scipy/linalg/_decomp_update.pyx":719
17812 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
17813 : * c, sn.conjugate())
17814 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
17815 : *
17816 : * if p_full > 0:
17817 : */
17818 36 : free(__pyx_v_s);
17819 :
17820 : /* "scipy/linalg/_decomp_update.pyx":721
17821 : * libc.stdlib.free(s)
17822 : *
17823 : * if p_full > 0: # <<<<<<<<<<<<<<
17824 : * # if this is true, we have ensured the u is also F contiguous.
17825 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
17826 : */
17827 36 : __pyx_t_1 = (__pyx_v_p_full > 0);
17828 36 : if (__pyx_t_1) {
17829 :
17830 : /* "scipy/linalg/_decomp_update.pyx":723
17831 : * if p_full > 0:
17832 : * # if this is true, we have ensured the u is also F contiguous.
17833 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0, # <<<<<<<<<<<<<<
17834 : * col(r, rs, k+p_eco), m)
17835 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
17836 : */
17837 8 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_TC, __pyx_v_N, __pyx_v_m, __pyx_v_p_full, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_p_eco), __pyx_v_m, 0.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco)), __pyx_v_m);
17838 :
17839 : /* "scipy/linalg/_decomp_update.pyx":725
17840 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
17841 : * col(r, rs, k+p_eco), m)
17842 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full) # <<<<<<<<<<<<<<
17843 : *
17844 : * return 0
17845 : */
17846 8 : (void)(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, ((__pyx_v_n + __pyx_v_p_eco) + __pyx_v_p_full), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco), __pyx_v_p_full));
17847 :
17848 : /* "scipy/linalg/_decomp_update.pyx":721
17849 : * libc.stdlib.free(s)
17850 : *
17851 : * if p_full > 0: # <<<<<<<<<<<<<<
17852 : * # if this is true, we have ensured the u is also F contiguous.
17853 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
17854 : */
17855 : }
17856 :
17857 : /* "scipy/linalg/_decomp_update.pyx":727
17858 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
17859 : *
17860 : * return 0 # <<<<<<<<<<<<<<
17861 : *
17862 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
17863 : */
17864 36 : __pyx_r = 0;
17865 36 : goto __pyx_L0;
17866 :
17867 : /* "scipy/linalg/_decomp_update.pyx":665
17868 : * return 0
17869 : *
17870 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
17871 : * int* rs, blas_t* u, int* us, int k, int p_eco,
17872 : * int p_full, blas_t* rcond) noexcept nogil:
17873 : */
17874 :
17875 : /* function exit code */
17876 37 : __pyx_L0:;
17877 37 : return __pyx_r;
17878 : }
17879 :
17880 37 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full, __pyx_t_float_complex *__pyx_v_rcond) {
17881 37 : int __pyx_v_i;
17882 37 : int __pyx_v_j;
17883 37 : int __pyx_v_info;
17884 37 : __pyx_t_float_complex __pyx_v_c;
17885 37 : __pyx_t_float_complex __pyx_v_sn;
17886 37 : CYTHON_UNUSED __pyx_t_float_complex __pyx_v_rc0;
17887 37 : __pyx_t_float_complex __pyx_v_rc;
17888 37 : __pyx_t_float_complex *__pyx_v_s;
17889 37 : char *__pyx_v_N;
17890 37 : CYTHON_UNUSED char *__pyx_v_T;
17891 37 : char *__pyx_v_C;
17892 37 : char *__pyx_v_TC;
17893 37 : int __pyx_r;
17894 37 : int __pyx_t_1;
17895 37 : int __pyx_t_2;
17896 37 : int __pyx_t_3;
17897 37 : int __pyx_t_4;
17898 37 : long __pyx_t_5;
17899 37 : long __pyx_t_6;
17900 37 : int __pyx_t_7;
17901 :
17902 : /* "scipy/linalg/_decomp_update.pyx":673
17903 : * cdef blas_t rc0, rc;
17904 : * cdef blas_t* s
17905 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
17906 : * cdef char* T = 'T'
17907 : * cdef char* C = 'C'
17908 : */
17909 37 : __pyx_v_N = ((char *)"N");
17910 :
17911 : /* "scipy/linalg/_decomp_update.pyx":674
17912 : * cdef blas_t* s
17913 : * cdef char* N = 'N'
17914 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
17915 : * cdef char* C = 'C'
17916 : * cdef char* TC
17917 : */
17918 37 : __pyx_v_T = ((char *)"T");
17919 :
17920 : /* "scipy/linalg/_decomp_update.pyx":675
17921 : * cdef char* N = 'N'
17922 : * cdef char* T = 'T'
17923 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
17924 : * cdef char* TC
17925 : *
17926 : */
17927 37 : __pyx_v_C = ((char *)"C");
17928 :
17929 : /* "scipy/linalg/_decomp_update.pyx":682
17930 : * rc0 = rcond[0]
17931 : * elif blas_t is float_complex:
17932 : * TC = C # <<<<<<<<<<<<<<
17933 : * rc0 = (<float*>rcond)[0]
17934 : * else:
17935 : */
17936 37 : __pyx_v_TC = __pyx_v_C;
17937 :
17938 : /* "scipy/linalg/_decomp_update.pyx":683
17939 : * elif blas_t is float_complex:
17940 : * TC = C
17941 : * rc0 = (<float*>rcond)[0] # <<<<<<<<<<<<<<
17942 : * else:
17943 : * TC = C
17944 : */
17945 37 : __pyx_v_rc0 = __pyx_t_float_complex_from_parts((((float *)__pyx_v_rcond)[0]), 0);
17946 :
17947 : /* "scipy/linalg/_decomp_update.pyx":694
17948 : * # original system, not the new system.
17949 : *
17950 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t)) # <<<<<<<<<<<<<<
17951 : * if not s:
17952 : * return MEMORY_ERROR
17953 : */
17954 37 : __pyx_v_s = ((__pyx_t_float_complex *)malloc(((2 * (__pyx_v_n + __pyx_v_p_eco)) * (sizeof(__pyx_t_float_complex)))));
17955 :
17956 : /* "scipy/linalg/_decomp_update.pyx":695
17957 : *
17958 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17959 : * if not s: # <<<<<<<<<<<<<<
17960 : * return MEMORY_ERROR
17961 : *
17962 : */
17963 37 : __pyx_t_1 = (!(__pyx_v_s != 0));
17964 37 : if (__pyx_t_1) {
17965 :
17966 : /* "scipy/linalg/_decomp_update.pyx":696
17967 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17968 : * if not s:
17969 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
17970 : *
17971 : * for j in range(p_eco):
17972 : */
17973 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
17974 0 : goto __pyx_L0;
17975 :
17976 : /* "scipy/linalg/_decomp_update.pyx":695
17977 : *
17978 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
17979 : * if not s: # <<<<<<<<<<<<<<
17980 : * return MEMORY_ERROR
17981 : *
17982 : */
17983 : }
17984 :
17985 : /* "scipy/linalg/_decomp_update.pyx":698
17986 : * return MEMORY_ERROR
17987 : *
17988 : * for j in range(p_eco): # <<<<<<<<<<<<<<
17989 : * rc = rcond[0]
17990 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
17991 : */
17992 : __pyx_t_2 = __pyx_v_p_eco;
17993 : __pyx_t_3 = __pyx_t_2;
17994 157 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17995 121 : __pyx_v_j = __pyx_t_4;
17996 :
17997 : /* "scipy/linalg/_decomp_update.pyx":699
17998 : *
17999 : * for j in range(p_eco):
18000 : * rc = rcond[0] # <<<<<<<<<<<<<<
18001 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
18002 : * if info == 2:
18003 : */
18004 121 : __pyx_v_rc = (__pyx_v_rcond[0]);
18005 :
18006 : /* "scipy/linalg/_decomp_update.pyx":700
18007 : * for j in range(p_eco):
18008 : * rc = rcond[0]
18009 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc) # <<<<<<<<<<<<<<
18010 : * if info == 2:
18011 : * if blas_t is float or blas_t is double:
18012 : */
18013 121 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, (__pyx_v_n + __pyx_v_j), __pyx_v_q, __pyx_v_qs, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_v_s, (&__pyx_v_rc));
18014 :
18015 : /* "scipy/linalg/_decomp_update.pyx":701
18016 : * rc = rcond[0]
18017 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
18018 : * if info == 2: # <<<<<<<<<<<<<<
18019 : * if blas_t is float or blas_t is double:
18020 : * rcond[0] = rc;
18021 : */
18022 121 : __pyx_t_1 = (__pyx_v_info == 2);
18023 121 : if (__pyx_t_1) {
18024 :
18025 : /* "scipy/linalg/_decomp_update.pyx":705
18026 : * rcond[0] = rc;
18027 : * elif blas_t is float_complex:
18028 : * rcond[0] = (<float*>&rc)[0] # <<<<<<<<<<<<<<
18029 : * else:
18030 : * rcond[0] = (<double*>&rc)[0]
18031 : */
18032 1 : (__pyx_v_rcond[0]) = __pyx_t_float_complex_from_parts((((float *)(&__pyx_v_rc))[0]), 0);
18033 :
18034 : /* "scipy/linalg/_decomp_update.pyx":708
18035 : * else:
18036 : * rcond[0] = (<double*>&rc)[0]
18037 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
18038 : * return info
18039 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
18040 : */
18041 1 : free(__pyx_v_s);
18042 :
18043 : /* "scipy/linalg/_decomp_update.pyx":709
18044 : * rcond[0] = (<double*>&rc)[0]
18045 : * libc.stdlib.free(s)
18046 : * return info # <<<<<<<<<<<<<<
18047 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
18048 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
18049 : */
18050 1 : __pyx_r = __pyx_v_info;
18051 1 : goto __pyx_L0;
18052 :
18053 : /* "scipy/linalg/_decomp_update.pyx":701
18054 : * rc = rcond[0]
18055 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
18056 : * if info == 2: # <<<<<<<<<<<<<<
18057 : * if blas_t is float or blas_t is double:
18058 : * rcond[0] = rc;
18059 : */
18060 : }
18061 :
18062 : /* "scipy/linalg/_decomp_update.pyx":710
18063 : * libc.stdlib.free(s)
18064 : * return info
18065 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0]) # <<<<<<<<<<<<<<
18066 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
18067 : *
18068 : */
18069 120 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n + __pyx_v_j)), (__pyx_v_qs[0]));
18070 :
18071 : /* "scipy/linalg/_decomp_update.pyx":711
18072 : * return info
18073 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
18074 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0]) # <<<<<<<<<<<<<<
18075 : *
18076 : * for i in range(n-2+1, k-1, -1):
18077 : */
18078 120 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n + __pyx_v_j) + 1), __pyx_v_s, 1, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_j)), (__pyx_v_rs[0]));
18079 :
18080 : /* "scipy/linalg/_decomp_update.pyx":713
18081 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
18082 : *
18083 : * for i in range(n-2+1, k-1, -1): # <<<<<<<<<<<<<<
18084 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
18085 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
18086 : */
18087 120 : __pyx_t_5 = (__pyx_v_k - 1);
18088 120 : __pyx_t_6 = __pyx_t_5;
18089 516 : for (__pyx_t_7 = ((__pyx_v_n - 2) + 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
18090 396 : __pyx_v_i = __pyx_t_7;
18091 :
18092 : /* "scipy/linalg/_decomp_update.pyx":714
18093 : *
18094 : * for i in range(n-2+1, k-1, -1):
18095 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn) # <<<<<<<<<<<<<<
18096 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
18097 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
18098 : */
18099 396 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), (__pyx_v_k + __pyx_v_j)), (&__pyx_v_c), (&__pyx_v_sn));
18100 :
18101 : /* "scipy/linalg/_decomp_update.pyx":715
18102 : * for i in range(n-2+1, k-1, -1):
18103 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
18104 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1], # <<<<<<<<<<<<<<
18105 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
18106 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
18107 : */
18108 396 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_i), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
18109 :
18110 : /* "scipy/linalg/_decomp_update.pyx":717
18111 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
18112 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
18113 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0], # <<<<<<<<<<<<<<
18114 : * c, sn.conjugate())
18115 : * libc.stdlib.free(s)
18116 : */
18117 396 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_i + __pyx_v_j)), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, ((__pyx_v_i + __pyx_v_j) + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_sn));
18118 : }
18119 : }
18120 :
18121 : /* "scipy/linalg/_decomp_update.pyx":719
18122 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
18123 : * c, sn.conjugate())
18124 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
18125 : *
18126 : * if p_full > 0:
18127 : */
18128 36 : free(__pyx_v_s);
18129 :
18130 : /* "scipy/linalg/_decomp_update.pyx":721
18131 : * libc.stdlib.free(s)
18132 : *
18133 : * if p_full > 0: # <<<<<<<<<<<<<<
18134 : * # if this is true, we have ensured the u is also F contiguous.
18135 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
18136 : */
18137 36 : __pyx_t_1 = (__pyx_v_p_full > 0);
18138 36 : if (__pyx_t_1) {
18139 :
18140 : /* "scipy/linalg/_decomp_update.pyx":723
18141 : * if p_full > 0:
18142 : * # if this is true, we have ensured the u is also F contiguous.
18143 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0, # <<<<<<<<<<<<<<
18144 : * col(r, rs, k+p_eco), m)
18145 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
18146 : */
18147 16 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_TC, __pyx_v_N, __pyx_v_m, __pyx_v_p_full, __pyx_v_m, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_p_eco), __pyx_v_m, __pyx_t_float_complex_from_parts(0, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco)), __pyx_v_m);
18148 :
18149 : /* "scipy/linalg/_decomp_update.pyx":725
18150 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
18151 : * col(r, rs, k+p_eco), m)
18152 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full) # <<<<<<<<<<<<<<
18153 : *
18154 : * return 0
18155 : */
18156 8 : (void)(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, ((__pyx_v_n + __pyx_v_p_eco) + __pyx_v_p_full), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco), __pyx_v_p_full));
18157 :
18158 : /* "scipy/linalg/_decomp_update.pyx":721
18159 : * libc.stdlib.free(s)
18160 : *
18161 : * if p_full > 0: # <<<<<<<<<<<<<<
18162 : * # if this is true, we have ensured the u is also F contiguous.
18163 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
18164 : */
18165 : }
18166 :
18167 : /* "scipy/linalg/_decomp_update.pyx":727
18168 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
18169 : *
18170 : * return 0 # <<<<<<<<<<<<<<
18171 : *
18172 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
18173 : */
18174 36 : __pyx_r = 0;
18175 36 : goto __pyx_L0;
18176 :
18177 : /* "scipy/linalg/_decomp_update.pyx":665
18178 : * return 0
18179 : *
18180 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
18181 : * int* rs, blas_t* u, int* us, int k, int p_eco,
18182 : * int p_full, blas_t* rcond) noexcept nogil:
18183 : */
18184 :
18185 : /* function exit code */
18186 37 : __pyx_L0:;
18187 37 : return __pyx_r;
18188 : }
18189 :
18190 37 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, int __pyx_v_k, int __pyx_v_p_eco, int __pyx_v_p_full, __pyx_t_double_complex *__pyx_v_rcond) {
18191 37 : int __pyx_v_i;
18192 37 : int __pyx_v_j;
18193 37 : int __pyx_v_info;
18194 37 : __pyx_t_double_complex __pyx_v_c;
18195 37 : __pyx_t_double_complex __pyx_v_sn;
18196 37 : CYTHON_UNUSED __pyx_t_double_complex __pyx_v_rc0;
18197 37 : __pyx_t_double_complex __pyx_v_rc;
18198 37 : __pyx_t_double_complex *__pyx_v_s;
18199 37 : char *__pyx_v_N;
18200 37 : CYTHON_UNUSED char *__pyx_v_T;
18201 37 : char *__pyx_v_C;
18202 37 : char *__pyx_v_TC;
18203 37 : int __pyx_r;
18204 37 : int __pyx_t_1;
18205 37 : int __pyx_t_2;
18206 37 : int __pyx_t_3;
18207 37 : int __pyx_t_4;
18208 37 : long __pyx_t_5;
18209 37 : long __pyx_t_6;
18210 37 : int __pyx_t_7;
18211 :
18212 : /* "scipy/linalg/_decomp_update.pyx":673
18213 : * cdef blas_t rc0, rc;
18214 : * cdef blas_t* s
18215 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
18216 : * cdef char* T = 'T'
18217 : * cdef char* C = 'C'
18218 : */
18219 37 : __pyx_v_N = ((char *)"N");
18220 :
18221 : /* "scipy/linalg/_decomp_update.pyx":674
18222 : * cdef blas_t* s
18223 : * cdef char* N = 'N'
18224 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
18225 : * cdef char* C = 'C'
18226 : * cdef char* TC
18227 : */
18228 37 : __pyx_v_T = ((char *)"T");
18229 :
18230 : /* "scipy/linalg/_decomp_update.pyx":675
18231 : * cdef char* N = 'N'
18232 : * cdef char* T = 'T'
18233 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
18234 : * cdef char* TC
18235 : *
18236 : */
18237 37 : __pyx_v_C = ((char *)"C");
18238 :
18239 : /* "scipy/linalg/_decomp_update.pyx":685
18240 : * rc0 = (<float*>rcond)[0]
18241 : * else:
18242 : * TC = C # <<<<<<<<<<<<<<
18243 : * rc0 = (<double*>rcond)[0]
18244 : *
18245 : */
18246 37 : __pyx_v_TC = __pyx_v_C;
18247 :
18248 : /* "scipy/linalg/_decomp_update.pyx":686
18249 : * else:
18250 : * TC = C
18251 : * rc0 = (<double*>rcond)[0] # <<<<<<<<<<<<<<
18252 : *
18253 : * # on entry, Q and R have both been increased in size, Q via the appending
18254 : */
18255 37 : __pyx_v_rc0 = __pyx_t_double_complex_from_parts((((double *)__pyx_v_rcond)[0]), 0);
18256 :
18257 : /* "scipy/linalg/_decomp_update.pyx":694
18258 : * # original system, not the new system.
18259 : *
18260 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t)) # <<<<<<<<<<<<<<
18261 : * if not s:
18262 : * return MEMORY_ERROR
18263 : */
18264 37 : __pyx_v_s = ((__pyx_t_double_complex *)malloc(((2 * (__pyx_v_n + __pyx_v_p_eco)) * (sizeof(__pyx_t_double_complex)))));
18265 :
18266 : /* "scipy/linalg/_decomp_update.pyx":695
18267 : *
18268 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
18269 : * if not s: # <<<<<<<<<<<<<<
18270 : * return MEMORY_ERROR
18271 : *
18272 : */
18273 37 : __pyx_t_1 = (!(__pyx_v_s != 0));
18274 37 : if (__pyx_t_1) {
18275 :
18276 : /* "scipy/linalg/_decomp_update.pyx":696
18277 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
18278 : * if not s:
18279 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
18280 : *
18281 : * for j in range(p_eco):
18282 : */
18283 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
18284 0 : goto __pyx_L0;
18285 :
18286 : /* "scipy/linalg/_decomp_update.pyx":695
18287 : *
18288 : * s = <blas_t*>libc.stdlib.malloc(2*(n+p_eco)*sizeof(blas_t))
18289 : * if not s: # <<<<<<<<<<<<<<
18290 : * return MEMORY_ERROR
18291 : *
18292 : */
18293 : }
18294 :
18295 : /* "scipy/linalg/_decomp_update.pyx":698
18296 : * return MEMORY_ERROR
18297 : *
18298 : * for j in range(p_eco): # <<<<<<<<<<<<<<
18299 : * rc = rcond[0]
18300 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
18301 : */
18302 : __pyx_t_2 = __pyx_v_p_eco;
18303 : __pyx_t_3 = __pyx_t_2;
18304 157 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18305 121 : __pyx_v_j = __pyx_t_4;
18306 :
18307 : /* "scipy/linalg/_decomp_update.pyx":699
18308 : *
18309 : * for j in range(p_eco):
18310 : * rc = rcond[0] # <<<<<<<<<<<<<<
18311 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
18312 : * if info == 2:
18313 : */
18314 121 : __pyx_v_rc = (__pyx_v_rcond[0]);
18315 :
18316 : /* "scipy/linalg/_decomp_update.pyx":700
18317 : * for j in range(p_eco):
18318 : * rc = rcond[0]
18319 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc) # <<<<<<<<<<<<<<
18320 : * if info == 2:
18321 : * if blas_t is float or blas_t is double:
18322 : */
18323 121 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, (__pyx_v_n + __pyx_v_j), __pyx_v_q, __pyx_v_qs, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_v_s, (&__pyx_v_rc));
18324 :
18325 : /* "scipy/linalg/_decomp_update.pyx":701
18326 : * rc = rcond[0]
18327 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
18328 : * if info == 2: # <<<<<<<<<<<<<<
18329 : * if blas_t is float or blas_t is double:
18330 : * rcond[0] = rc;
18331 : */
18332 121 : __pyx_t_1 = (__pyx_v_info == 2);
18333 121 : if (__pyx_t_1) {
18334 :
18335 : /* "scipy/linalg/_decomp_update.pyx":707
18336 : * rcond[0] = (<float*>&rc)[0]
18337 : * else:
18338 : * rcond[0] = (<double*>&rc)[0] # <<<<<<<<<<<<<<
18339 : * libc.stdlib.free(s)
18340 : * return info
18341 : */
18342 1 : (__pyx_v_rcond[0]) = __pyx_t_double_complex_from_parts((((double *)(&__pyx_v_rc))[0]), 0);
18343 :
18344 : /* "scipy/linalg/_decomp_update.pyx":708
18345 : * else:
18346 : * rcond[0] = (<double*>&rc)[0]
18347 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
18348 : * return info
18349 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
18350 : */
18351 1 : free(__pyx_v_s);
18352 :
18353 : /* "scipy/linalg/_decomp_update.pyx":709
18354 : * rcond[0] = (<double*>&rc)[0]
18355 : * libc.stdlib.free(s)
18356 : * return info # <<<<<<<<<<<<<<
18357 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
18358 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
18359 : */
18360 1 : __pyx_r = __pyx_v_info;
18361 1 : goto __pyx_L0;
18362 :
18363 : /* "scipy/linalg/_decomp_update.pyx":701
18364 : * rc = rcond[0]
18365 : * info = reorth(m, n+j, q, qs, True, col(u, us, j), us, s, &rc)
18366 : * if info == 2: # <<<<<<<<<<<<<<
18367 : * if blas_t is float or blas_t is double:
18368 : * rcond[0] = rc;
18369 : */
18370 : }
18371 :
18372 : /* "scipy/linalg/_decomp_update.pyx":710
18373 : * libc.stdlib.free(s)
18374 : * return info
18375 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0]) # <<<<<<<<<<<<<<
18376 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
18377 : *
18378 : */
18379 120 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), (__pyx_v_us[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n + __pyx_v_j)), (__pyx_v_qs[0]));
18380 :
18381 : /* "scipy/linalg/_decomp_update.pyx":711
18382 : * return info
18383 : * copy(m, col(u, us, j), us[0], col(q, qs, n+j), qs[0])
18384 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0]) # <<<<<<<<<<<<<<
18385 : *
18386 : * for i in range(n-2+1, k-1, -1):
18387 : */
18388 120 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_copy(((__pyx_v_n + __pyx_v_j) + 1), __pyx_v_s, 1, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_j)), (__pyx_v_rs[0]));
18389 :
18390 : /* "scipy/linalg/_decomp_update.pyx":713
18391 : * copy(n+j+1, s, 1, col(r, rs, k+j), rs[0])
18392 : *
18393 : * for i in range(n-2+1, k-1, -1): # <<<<<<<<<<<<<<
18394 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
18395 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
18396 : */
18397 120 : __pyx_t_5 = (__pyx_v_k - 1);
18398 120 : __pyx_t_6 = __pyx_t_5;
18399 516 : for (__pyx_t_7 = ((__pyx_v_n - 2) + 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
18400 396 : __pyx_v_i = __pyx_t_7;
18401 :
18402 : /* "scipy/linalg/_decomp_update.pyx":714
18403 : *
18404 : * for i in range(n-2+1, k-1, -1):
18405 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn) # <<<<<<<<<<<<<<
18406 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
18407 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
18408 : */
18409 396 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), (__pyx_v_k + __pyx_v_j)), (&__pyx_v_c), (&__pyx_v_sn));
18410 :
18411 : /* "scipy/linalg/_decomp_update.pyx":715
18412 : * for i in range(n-2+1, k-1, -1):
18413 : * lartg(index2(r, rs, i+j, k+j), index2(r, rs, i+j+1, k+j), &c, &sn)
18414 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1], # <<<<<<<<<<<<<<
18415 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
18416 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
18417 : */
18418 396 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_i), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_i + __pyx_v_j), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, ((__pyx_v_i + __pyx_v_j) + 1), ((__pyx_v_i + __pyx_v_p_eco) + __pyx_v_p_full)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
18419 :
18420 : /* "scipy/linalg/_decomp_update.pyx":717
18421 : * rot(n-i, index2(r, rs, i+j, i+p_eco+p_full), rs[1],
18422 : * index2(r, rs, i+j+1, i+p_eco+p_full), rs[1], c, sn)
18423 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0], # <<<<<<<<<<<<<<
18424 : * c, sn.conjugate())
18425 : * libc.stdlib.free(s)
18426 : */
18427 396 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_i + __pyx_v_j)), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, ((__pyx_v_i + __pyx_v_j) + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_sn));
18428 : }
18429 : }
18430 :
18431 : /* "scipy/linalg/_decomp_update.pyx":719
18432 : * rot(m, col(q, qs, i+j), qs[0], col(q, qs, i+j+1), qs[0],
18433 : * c, sn.conjugate())
18434 : * libc.stdlib.free(s) # <<<<<<<<<<<<<<
18435 : *
18436 : * if p_full > 0:
18437 : */
18438 36 : free(__pyx_v_s);
18439 :
18440 : /* "scipy/linalg/_decomp_update.pyx":721
18441 : * libc.stdlib.free(s)
18442 : *
18443 : * if p_full > 0: # <<<<<<<<<<<<<<
18444 : * # if this is true, we have ensured the u is also F contiguous.
18445 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
18446 : */
18447 36 : __pyx_t_1 = (__pyx_v_p_full > 0);
18448 36 : if (__pyx_t_1) {
18449 :
18450 : /* "scipy/linalg/_decomp_update.pyx":723
18451 : * if p_full > 0:
18452 : * # if this is true, we have ensured the u is also F contiguous.
18453 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0, # <<<<<<<<<<<<<<
18454 : * col(r, rs, k+p_eco), m)
18455 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
18456 : */
18457 16 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_TC, __pyx_v_N, __pyx_v_m, __pyx_v_p_full, __pyx_v_m, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_p_eco), __pyx_v_m, __pyx_t_double_complex_from_parts(0, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco)), __pyx_v_m);
18458 :
18459 : /* "scipy/linalg/_decomp_update.pyx":725
18460 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
18461 : * col(r, rs, k+p_eco), m)
18462 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full) # <<<<<<<<<<<<<<
18463 : *
18464 : * return 0
18465 : */
18466 8 : (void)(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, ((__pyx_v_n + __pyx_v_p_eco) + __pyx_v_p_full), __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, (__pyx_v_k + __pyx_v_p_eco), __pyx_v_p_full));
18467 :
18468 : /* "scipy/linalg/_decomp_update.pyx":721
18469 : * libc.stdlib.free(s)
18470 : *
18471 : * if p_full > 0: # <<<<<<<<<<<<<<
18472 : * # if this is true, we have ensured the u is also F contiguous.
18473 : * gemm(TC, N, m, p_full, m, 1, q, m, col(u, us, p_eco), m, 0,
18474 : */
18475 : }
18476 :
18477 : /* "scipy/linalg/_decomp_update.pyx":727
18478 : * qr_block_col_insert(m, n+p_eco+p_full, q, qs, r, rs, k+p_eco, p_full)
18479 : *
18480 : * return 0 # <<<<<<<<<<<<<<
18481 : *
18482 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
18483 : */
18484 36 : __pyx_r = 0;
18485 36 : goto __pyx_L0;
18486 :
18487 : /* "scipy/linalg/_decomp_update.pyx":665
18488 : * return 0
18489 : *
18490 : * cdef int thin_qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
18491 : * int* rs, blas_t* u, int* us, int k, int p_eco,
18492 : * int p_full, blas_t* rcond) noexcept nogil:
18493 : */
18494 :
18495 : /* function exit code */
18496 37 : __pyx_L0:;
18497 37 : return __pyx_r;
18498 : }
18499 :
18500 : /* "scipy/linalg/_decomp_update.pyx":729
18501 : * return 0
18502 : *
18503 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
18504 : * int k) noexcept nogil:
18505 : * cdef int j
18506 : */
18507 :
18508 132 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
18509 132 : int __pyx_v_j;
18510 132 : float __pyx_v_c;
18511 132 : float __pyx_v_s;
18512 132 : long __pyx_t_1;
18513 132 : long __pyx_t_2;
18514 132 : int __pyx_t_3;
18515 132 : int __pyx_t_4;
18516 :
18517 : /* "scipy/linalg/_decomp_update.pyx":735
18518 : * cdef blas_t* work
18519 : *
18520 : * for j in range(m-2, k-1, -1): # <<<<<<<<<<<<<<
18521 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s)
18522 : *
18523 : */
18524 132 : __pyx_t_1 = (__pyx_v_k - 1);
18525 132 : __pyx_t_2 = __pyx_t_1;
18526 1050 : for (__pyx_t_3 = (__pyx_v_m - 2); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
18527 918 : __pyx_v_j = __pyx_t_3;
18528 :
18529 : /* "scipy/linalg/_decomp_update.pyx":736
18530 : *
18531 : * for j in range(m-2, k-1, -1):
18532 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s) # <<<<<<<<<<<<<<
18533 : *
18534 : * # update r if j is a nonzero row
18535 : */
18536 918 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_k), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_k), (&__pyx_v_c), (&__pyx_v_s));
18537 :
18538 : /* "scipy/linalg/_decomp_update.pyx":739
18539 : *
18540 : * # update r if j is a nonzero row
18541 : * if j+1 < n: # <<<<<<<<<<<<<<
18542 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18543 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18544 : */
18545 918 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
18546 918 : if (__pyx_t_4) {
18547 :
18548 : /* "scipy/linalg/_decomp_update.pyx":740
18549 : * # update r if j is a nonzero row
18550 : * if j+1 < n:
18551 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
18552 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18553 : *
18554 : */
18555 746 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
18556 :
18557 : /* "scipy/linalg/_decomp_update.pyx":739
18558 : *
18559 : * # update r if j is a nonzero row
18560 : * if j+1 < n: # <<<<<<<<<<<<<<
18561 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18562 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18563 : */
18564 : }
18565 :
18566 : /* "scipy/linalg/_decomp_update.pyx":744
18567 : *
18568 : * # update the columns of q
18569 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
18570 : *
18571 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs,
18572 : */
18573 918 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
18574 : }
18575 :
18576 : /* "scipy/linalg/_decomp_update.pyx":729
18577 : * return 0
18578 : *
18579 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
18580 : * int k) noexcept nogil:
18581 : * cdef int j
18582 : */
18583 :
18584 : /* function exit code */
18585 132 : }
18586 :
18587 16378 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
18588 16378 : int __pyx_v_j;
18589 16378 : double __pyx_v_c;
18590 16378 : double __pyx_v_s;
18591 16378 : long __pyx_t_1;
18592 16378 : long __pyx_t_2;
18593 16378 : int __pyx_t_3;
18594 16378 : int __pyx_t_4;
18595 :
18596 : /* "scipy/linalg/_decomp_update.pyx":735
18597 : * cdef blas_t* work
18598 : *
18599 : * for j in range(m-2, k-1, -1): # <<<<<<<<<<<<<<
18600 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s)
18601 : *
18602 : */
18603 16378 : __pyx_t_1 = (__pyx_v_k - 1);
18604 16378 : __pyx_t_2 = __pyx_t_1;
18605 33542 : for (__pyx_t_3 = (__pyx_v_m - 2); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
18606 17164 : __pyx_v_j = __pyx_t_3;
18607 :
18608 : /* "scipy/linalg/_decomp_update.pyx":736
18609 : *
18610 : * for j in range(m-2, k-1, -1):
18611 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s) # <<<<<<<<<<<<<<
18612 : *
18613 : * # update r if j is a nonzero row
18614 : */
18615 17164 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_k), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_k), (&__pyx_v_c), (&__pyx_v_s));
18616 :
18617 : /* "scipy/linalg/_decomp_update.pyx":739
18618 : *
18619 : * # update r if j is a nonzero row
18620 : * if j+1 < n: # <<<<<<<<<<<<<<
18621 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18622 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18623 : */
18624 17164 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
18625 17164 : if (__pyx_t_4) {
18626 :
18627 : /* "scipy/linalg/_decomp_update.pyx":740
18628 : * # update r if j is a nonzero row
18629 : * if j+1 < n:
18630 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
18631 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18632 : *
18633 : */
18634 746 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
18635 :
18636 : /* "scipy/linalg/_decomp_update.pyx":739
18637 : *
18638 : * # update r if j is a nonzero row
18639 : * if j+1 < n: # <<<<<<<<<<<<<<
18640 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18641 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18642 : */
18643 : }
18644 :
18645 : /* "scipy/linalg/_decomp_update.pyx":744
18646 : *
18647 : * # update the columns of q
18648 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
18649 : *
18650 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs,
18651 : */
18652 17164 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
18653 : }
18654 :
18655 : /* "scipy/linalg/_decomp_update.pyx":729
18656 : * return 0
18657 : *
18658 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
18659 : * int k) noexcept nogil:
18660 : * cdef int j
18661 : */
18662 :
18663 : /* function exit code */
18664 16378 : }
18665 :
18666 132 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
18667 132 : int __pyx_v_j;
18668 132 : __pyx_t_float_complex __pyx_v_c;
18669 132 : __pyx_t_float_complex __pyx_v_s;
18670 132 : long __pyx_t_1;
18671 132 : long __pyx_t_2;
18672 132 : int __pyx_t_3;
18673 132 : int __pyx_t_4;
18674 :
18675 : /* "scipy/linalg/_decomp_update.pyx":735
18676 : * cdef blas_t* work
18677 : *
18678 : * for j in range(m-2, k-1, -1): # <<<<<<<<<<<<<<
18679 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s)
18680 : *
18681 : */
18682 132 : __pyx_t_1 = (__pyx_v_k - 1);
18683 132 : __pyx_t_2 = __pyx_t_1;
18684 1050 : for (__pyx_t_3 = (__pyx_v_m - 2); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
18685 918 : __pyx_v_j = __pyx_t_3;
18686 :
18687 : /* "scipy/linalg/_decomp_update.pyx":736
18688 : *
18689 : * for j in range(m-2, k-1, -1):
18690 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s) # <<<<<<<<<<<<<<
18691 : *
18692 : * # update r if j is a nonzero row
18693 : */
18694 918 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_k), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_k), (&__pyx_v_c), (&__pyx_v_s));
18695 :
18696 : /* "scipy/linalg/_decomp_update.pyx":739
18697 : *
18698 : * # update r if j is a nonzero row
18699 : * if j+1 < n: # <<<<<<<<<<<<<<
18700 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18701 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18702 : */
18703 918 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
18704 918 : if (__pyx_t_4) {
18705 :
18706 : /* "scipy/linalg/_decomp_update.pyx":740
18707 : * # update r if j is a nonzero row
18708 : * if j+1 < n:
18709 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
18710 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18711 : *
18712 : */
18713 746 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
18714 :
18715 : /* "scipy/linalg/_decomp_update.pyx":739
18716 : *
18717 : * # update r if j is a nonzero row
18718 : * if j+1 < n: # <<<<<<<<<<<<<<
18719 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18720 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18721 : */
18722 : }
18723 :
18724 : /* "scipy/linalg/_decomp_update.pyx":744
18725 : *
18726 : * # update the columns of q
18727 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
18728 : *
18729 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs,
18730 : */
18731 918 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
18732 : }
18733 :
18734 : /* "scipy/linalg/_decomp_update.pyx":729
18735 : * return 0
18736 : *
18737 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
18738 : * int k) noexcept nogil:
18739 : * cdef int j
18740 : */
18741 :
18742 : /* function exit code */
18743 132 : }
18744 :
18745 680 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
18746 680 : int __pyx_v_j;
18747 680 : __pyx_t_double_complex __pyx_v_c;
18748 680 : __pyx_t_double_complex __pyx_v_s;
18749 680 : long __pyx_t_1;
18750 680 : long __pyx_t_2;
18751 680 : int __pyx_t_3;
18752 680 : int __pyx_t_4;
18753 :
18754 : /* "scipy/linalg/_decomp_update.pyx":735
18755 : * cdef blas_t* work
18756 : *
18757 : * for j in range(m-2, k-1, -1): # <<<<<<<<<<<<<<
18758 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s)
18759 : *
18760 : */
18761 680 : __pyx_t_1 = (__pyx_v_k - 1);
18762 680 : __pyx_t_2 = __pyx_t_1;
18763 2146 : for (__pyx_t_3 = (__pyx_v_m - 2); __pyx_t_3 > __pyx_t_2; __pyx_t_3-=1) {
18764 1466 : __pyx_v_j = __pyx_t_3;
18765 :
18766 : /* "scipy/linalg/_decomp_update.pyx":736
18767 : *
18768 : * for j in range(m-2, k-1, -1):
18769 : * lartg(index2(r, rs, j, k), index2(r, rs, j+1, k), &c, &s) # <<<<<<<<<<<<<<
18770 : *
18771 : * # update r if j is a nonzero row
18772 : */
18773 1466 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_k), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_k), (&__pyx_v_c), (&__pyx_v_s));
18774 :
18775 : /* "scipy/linalg/_decomp_update.pyx":739
18776 : *
18777 : * # update r if j is a nonzero row
18778 : * if j+1 < n: # <<<<<<<<<<<<<<
18779 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18780 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18781 : */
18782 1466 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
18783 1466 : if (__pyx_t_4) {
18784 :
18785 : /* "scipy/linalg/_decomp_update.pyx":740
18786 : * # update r if j is a nonzero row
18787 : * if j+1 < n:
18788 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
18789 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18790 : *
18791 : */
18792 746 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
18793 :
18794 : /* "scipy/linalg/_decomp_update.pyx":739
18795 : *
18796 : * # update r if j is a nonzero row
18797 : * if j+1 < n: # <<<<<<<<<<<<<<
18798 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
18799 : * index2(r, rs, j+1, j+1), rs[1], c, s)
18800 : */
18801 : }
18802 :
18803 : /* "scipy/linalg/_decomp_update.pyx":744
18804 : *
18805 : * # update the columns of q
18806 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
18807 : *
18808 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs,
18809 : */
18810 1466 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
18811 : }
18812 :
18813 : /* "scipy/linalg/_decomp_update.pyx":729
18814 : * return 0
18815 : *
18816 : * cdef void qr_col_insert(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
18817 : * int k) noexcept nogil:
18818 : * cdef int j
18819 : */
18820 :
18821 : /* function exit code */
18822 680 : }
18823 :
18824 : /* "scipy/linalg/_decomp_update.pyx":746
18825 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
18826 : *
18827 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
18828 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
18829 : * cdef int i, j
18830 : */
18831 :
18832 154 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
18833 154 : int __pyx_v_i;
18834 154 : int __pyx_v_j;
18835 154 : float __pyx_v_c;
18836 154 : float __pyx_v_s;
18837 154 : float *__pyx_v_tau;
18838 154 : float *__pyx_v_work;
18839 154 : int __pyx_v_info;
18840 154 : int __pyx_v_lwork;
18841 154 : char *__pyx_v_side;
18842 154 : char *__pyx_v_trans;
18843 154 : int __pyx_r;
18844 154 : int __pyx_t_1;
18845 154 : int __pyx_t_2;
18846 154 : int __pyx_t_3;
18847 154 : int __pyx_t_4;
18848 154 : long __pyx_t_5;
18849 154 : long __pyx_t_6;
18850 154 : int __pyx_t_7;
18851 :
18852 : /* "scipy/linalg/_decomp_update.pyx":750
18853 : * cdef int i, j
18854 : * cdef blas_t c, s
18855 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
18856 : * cdef blas_t* work = NULL
18857 : * cdef int info, lwork
18858 : */
18859 154 : __pyx_v_tau = NULL;
18860 :
18861 : /* "scipy/linalg/_decomp_update.pyx":751
18862 : * cdef blas_t c, s
18863 : * cdef blas_t* tau = NULL
18864 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
18865 : * cdef int info, lwork
18866 : * cdef char* side = 'R'
18867 : */
18868 154 : __pyx_v_work = NULL;
18869 :
18870 : /* "scipy/linalg/_decomp_update.pyx":753
18871 : * cdef blas_t* work = NULL
18872 : * cdef int info, lwork
18873 : * cdef char* side = 'R' # <<<<<<<<<<<<<<
18874 : * cdef char* trans = 'N'
18875 : *
18876 : */
18877 154 : __pyx_v_side = ((char *)"R");
18878 :
18879 : /* "scipy/linalg/_decomp_update.pyx":754
18880 : * cdef int info, lwork
18881 : * cdef char* side = 'R'
18882 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
18883 : *
18884 : * if m >= n:
18885 : */
18886 154 : __pyx_v_trans = ((char *)"N");
18887 :
18888 : /* "scipy/linalg/_decomp_update.pyx":756
18889 : * cdef char* trans = 'N'
18890 : *
18891 : * if m >= n: # <<<<<<<<<<<<<<
18892 : * # if m > n, r looks like this.
18893 : * # x x x x x x x x x x
18894 : */
18895 154 : __pyx_t_1 = (__pyx_v_m >= __pyx_v_n);
18896 154 : if (__pyx_t_1) {
18897 :
18898 : /* "scipy/linalg/_decomp_update.pyx":775
18899 : * # query the workspace,
18900 : * # set tau to point at something to keep new MKL working.
18901 : * tau = &c # <<<<<<<<<<<<<<
18902 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
18903 : * if info < 0:
18904 : */
18905 50 : __pyx_v_tau = (&__pyx_v_c);
18906 :
18907 : /* "scipy/linalg/_decomp_update.pyx":776
18908 : * # set tau to point at something to keep new MKL working.
18909 : * tau = &c
18910 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1) # <<<<<<<<<<<<<<
18911 : * if info < 0:
18912 : * return libc.stdlib.abs(info)
18913 : */
18914 50 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
18915 :
18916 : /* "scipy/linalg/_decomp_update.pyx":777
18917 : * tau = &c
18918 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
18919 : * if info < 0: # <<<<<<<<<<<<<<
18920 : * return libc.stdlib.abs(info)
18921 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
18922 : */
18923 50 : __pyx_t_1 = (__pyx_v_info < 0);
18924 50 : if (__pyx_t_1) {
18925 :
18926 : /* "scipy/linalg/_decomp_update.pyx":778
18927 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
18928 : * if info < 0:
18929 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
18930 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
18931 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
18932 : */
18933 0 : __pyx_r = abs(__pyx_v_info);
18934 0 : goto __pyx_L0;
18935 :
18936 : /* "scipy/linalg/_decomp_update.pyx":777
18937 : * tau = &c
18938 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
18939 : * if info < 0: # <<<<<<<<<<<<<<
18940 : * return libc.stdlib.abs(info)
18941 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
18942 : */
18943 : }
18944 :
18945 : /* "scipy/linalg/_decomp_update.pyx":779
18946 : * if info < 0:
18947 : * return libc.stdlib.abs(info)
18948 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
18949 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
18950 : * if info < 0:
18951 : */
18952 50 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, (&__pyx_v_s), -1);
18953 :
18954 : /* "scipy/linalg/_decomp_update.pyx":781
18955 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
18956 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
18957 : * if info < 0: # <<<<<<<<<<<<<<
18958 : * return info
18959 : *
18960 : */
18961 50 : __pyx_t_1 = (__pyx_v_info < 0);
18962 50 : if (__pyx_t_1) {
18963 :
18964 : /* "scipy/linalg/_decomp_update.pyx":782
18965 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
18966 : * if info < 0:
18967 : * return info # <<<<<<<<<<<<<<
18968 : *
18969 : * # we're only doing one allocation, so use the larger
18970 : */
18971 0 : __pyx_r = __pyx_v_info;
18972 0 : goto __pyx_L0;
18973 :
18974 : /* "scipy/linalg/_decomp_update.pyx":781
18975 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
18976 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
18977 : * if info < 0: # <<<<<<<<<<<<<<
18978 : * return info
18979 : *
18980 : */
18981 : }
18982 :
18983 : /* "scipy/linalg/_decomp_update.pyx":785
18984 : *
18985 : * # we're only doing one allocation, so use the larger
18986 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
18987 : *
18988 : * # allocate the workspace + tau
18989 : */
18990 50 : __pyx_v_lwork = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
18991 :
18992 : /* "scipy/linalg/_decomp_update.pyx":788
18993 : *
18994 : * # allocate the workspace + tau
18995 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
18996 : * if not work:
18997 : * return MEMORY_ERROR
18998 : */
18999 50 : __pyx_t_2 = __pyx_v_p;
19000 50 : __pyx_t_3 = ((__pyx_v_m - __pyx_v_n) + __pyx_v_p);
19001 50 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
19002 50 : if (__pyx_t_1) {
19003 : __pyx_t_4 = __pyx_t_2;
19004 : } else {
19005 : __pyx_t_4 = __pyx_t_3;
19006 : }
19007 50 : __pyx_v_work = ((float *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(float)))));
19008 :
19009 : /* "scipy/linalg/_decomp_update.pyx":789
19010 : * # allocate the workspace + tau
19011 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
19012 : * if not work: # <<<<<<<<<<<<<<
19013 : * return MEMORY_ERROR
19014 : * tau = work + lwork
19015 : */
19016 50 : __pyx_t_1 = (!(__pyx_v_work != 0));
19017 50 : if (__pyx_t_1) {
19018 :
19019 : /* "scipy/linalg/_decomp_update.pyx":790
19020 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
19021 : * if not work:
19022 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
19023 : * tau = work + lwork
19024 : *
19025 : */
19026 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
19027 0 : goto __pyx_L0;
19028 :
19029 : /* "scipy/linalg/_decomp_update.pyx":789
19030 : * # allocate the workspace + tau
19031 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
19032 : * if not work: # <<<<<<<<<<<<<<
19033 : * return MEMORY_ERROR
19034 : * tau = work + lwork
19035 : */
19036 : }
19037 :
19038 : /* "scipy/linalg/_decomp_update.pyx":791
19039 : * if not work:
19040 : * return MEMORY_ERROR
19041 : * tau = work + lwork # <<<<<<<<<<<<<<
19042 : *
19043 : * # qr
19044 : */
19045 50 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
19046 :
19047 : /* "scipy/linalg/_decomp_update.pyx":794
19048 : *
19049 : * # qr
19050 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork) # <<<<<<<<<<<<<<
19051 : * if info < 0:
19052 : * return libc.stdlib.abs(info)
19053 : */
19054 50 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
19055 :
19056 : /* "scipy/linalg/_decomp_update.pyx":795
19057 : * # qr
19058 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
19059 : * if info < 0: # <<<<<<<<<<<<<<
19060 : * return libc.stdlib.abs(info)
19061 : *
19062 : */
19063 50 : __pyx_t_1 = (__pyx_v_info < 0);
19064 50 : if (__pyx_t_1) {
19065 :
19066 : /* "scipy/linalg/_decomp_update.pyx":796
19067 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
19068 : * if info < 0:
19069 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
19070 : *
19071 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
19072 : */
19073 0 : __pyx_r = abs(__pyx_v_info);
19074 0 : goto __pyx_L0;
19075 :
19076 : /* "scipy/linalg/_decomp_update.pyx":795
19077 : * # qr
19078 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
19079 : * if info < 0: # <<<<<<<<<<<<<<
19080 : * return libc.stdlib.abs(info)
19081 : *
19082 : */
19083 : }
19084 :
19085 : /* "scipy/linalg/_decomp_update.pyx":799
19086 : *
19087 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
19088 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
19089 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19090 : * if info < 0:
19091 : */
19092 50 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
19093 :
19094 : /* "scipy/linalg/_decomp_update.pyx":801
19095 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19096 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19097 : * if info < 0: # <<<<<<<<<<<<<<
19098 : * return info
19099 : *
19100 : */
19101 50 : __pyx_t_1 = (__pyx_v_info < 0);
19102 50 : if (__pyx_t_1) {
19103 :
19104 : /* "scipy/linalg/_decomp_update.pyx":802
19105 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19106 : * if info < 0:
19107 : * return info # <<<<<<<<<<<<<<
19108 : *
19109 : * libc.stdlib.free(work)
19110 : */
19111 0 : __pyx_r = __pyx_v_info;
19112 0 : goto __pyx_L0;
19113 :
19114 : /* "scipy/linalg/_decomp_update.pyx":801
19115 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19116 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19117 : * if info < 0: # <<<<<<<<<<<<<<
19118 : * return info
19119 : *
19120 : */
19121 : }
19122 :
19123 : /* "scipy/linalg/_decomp_update.pyx":804
19124 : * return info
19125 : *
19126 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
19127 : *
19128 : * # zero the reflectors since we're done with them
19129 : */
19130 50 : free(__pyx_v_work);
19131 :
19132 : /* "scipy/linalg/_decomp_update.pyx":808
19133 : * # zero the reflectors since we're done with them
19134 : * # memset can be used here, since r is always fortran order
19135 : * for j in range(p): # <<<<<<<<<<<<<<
19136 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t))
19137 : *
19138 : */
19139 50 : __pyx_t_4 = __pyx_v_p;
19140 50 : __pyx_t_2 = __pyx_t_4;
19141 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19142 166 : __pyx_v_j = __pyx_t_3;
19143 :
19144 : /* "scipy/linalg/_decomp_update.pyx":809
19145 : * # memset can be used here, since r is always fortran order
19146 : * for j in range(p):
19147 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t)) # <<<<<<<<<<<<<<
19148 : *
19149 : * # now we have something that looks like
19150 : */
19151 166 : (void)(memset(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), 0, ((__pyx_v_m - (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j)) * (sizeof(float)))));
19152 : }
19153 :
19154 : /* "scipy/linalg/_decomp_update.pyx":827
19155 : * # and the rest of the columns need to be eliminated using rotations.
19156 : *
19157 : * for i in range(p): # <<<<<<<<<<<<<<
19158 : * for j in range(n-p+i-1, k+i-1, -1):
19159 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19160 : */
19161 216 : __pyx_t_4 = __pyx_v_p;
19162 216 : __pyx_t_2 = __pyx_t_4;
19163 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19164 166 : __pyx_v_i = __pyx_t_3;
19165 :
19166 : /* "scipy/linalg/_decomp_update.pyx":828
19167 : *
19168 : * for i in range(p):
19169 : * for j in range(n-p+i-1, k+i-1, -1): # <<<<<<<<<<<<<<
19170 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19171 : * if j+1 < n:
19172 : */
19173 166 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
19174 166 : __pyx_t_6 = __pyx_t_5;
19175 1065 : for (__pyx_t_7 = (((__pyx_v_n - __pyx_v_p) + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
19176 899 : __pyx_v_j = __pyx_t_7;
19177 :
19178 : /* "scipy/linalg/_decomp_update.pyx":829
19179 : * for i in range(p):
19180 : * for j in range(n-p+i-1, k+i-1, -1):
19181 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
19182 : * if j+1 < n:
19183 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19184 : */
19185 899 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
19186 :
19187 : /* "scipy/linalg/_decomp_update.pyx":830
19188 : * for j in range(n-p+i-1, k+i-1, -1):
19189 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19190 : * if j+1 < n: # <<<<<<<<<<<<<<
19191 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19192 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19193 : */
19194 899 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
19195 899 : if (__pyx_t_1) {
19196 :
19197 : /* "scipy/linalg/_decomp_update.pyx":831
19198 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19199 : * if j+1 < n:
19200 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
19201 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19202 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
19203 : */
19204 899 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
19205 :
19206 : /* "scipy/linalg/_decomp_update.pyx":830
19207 : * for j in range(n-p+i-1, k+i-1, -1):
19208 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19209 : * if j+1 < n: # <<<<<<<<<<<<<<
19210 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19211 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19212 : */
19213 : }
19214 :
19215 : /* "scipy/linalg/_decomp_update.pyx":833
19216 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19217 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19218 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
19219 : * c, s.conjugate())
19220 : * else:
19221 : */
19222 899 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
19223 : }
19224 : }
19225 :
19226 : /* "scipy/linalg/_decomp_update.pyx":756
19227 : * cdef char* trans = 'N'
19228 : *
19229 : * if m >= n: # <<<<<<<<<<<<<<
19230 : * # if m > n, r looks like this.
19231 : * # x x x x x x x x x x
19232 : */
19233 50 : goto __pyx_L3;
19234 : }
19235 :
19236 : /* "scipy/linalg/_decomp_update.pyx":837
19237 : * else:
19238 : * # this case we can only uses givens rotations.
19239 : * for i in range(p): # <<<<<<<<<<<<<<
19240 : * for j in range(m-2, k+i-1, -1):
19241 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19242 : */
19243 : /*else*/ {
19244 440 : __pyx_t_4 = __pyx_v_p;
19245 440 : __pyx_t_2 = __pyx_t_4;
19246 440 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19247 336 : __pyx_v_i = __pyx_t_3;
19248 :
19249 : /* "scipy/linalg/_decomp_update.pyx":838
19250 : * # this case we can only uses givens rotations.
19251 : * for i in range(p):
19252 : * for j in range(m-2, k+i-1, -1): # <<<<<<<<<<<<<<
19253 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19254 : * if j+1 < n:
19255 : */
19256 336 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
19257 336 : __pyx_t_6 = __pyx_t_5;
19258 1830 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
19259 1494 : __pyx_v_j = __pyx_t_7;
19260 :
19261 : /* "scipy/linalg/_decomp_update.pyx":839
19262 : * for i in range(p):
19263 : * for j in range(m-2, k+i-1, -1):
19264 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
19265 : * if j+1 < n:
19266 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19267 : */
19268 1494 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
19269 :
19270 : /* "scipy/linalg/_decomp_update.pyx":840
19271 : * for j in range(m-2, k+i-1, -1):
19272 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19273 : * if j+1 < n: # <<<<<<<<<<<<<<
19274 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19275 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19276 : */
19277 1494 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
19278 1494 : if (__pyx_t_1) {
19279 :
19280 : /* "scipy/linalg/_decomp_update.pyx":841
19281 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19282 : * if j+1 < n:
19283 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
19284 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19285 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
19286 : */
19287 1494 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
19288 :
19289 : /* "scipy/linalg/_decomp_update.pyx":840
19290 : * for j in range(m-2, k+i-1, -1):
19291 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19292 : * if j+1 < n: # <<<<<<<<<<<<<<
19293 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19294 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19295 : */
19296 : }
19297 :
19298 : /* "scipy/linalg/_decomp_update.pyx":843
19299 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19300 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19301 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
19302 : * c, s.conjugate())
19303 : * return 0
19304 : */
19305 1494 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
19306 : }
19307 : }
19308 : }
19309 104 : __pyx_L3:;
19310 :
19311 : /* "scipy/linalg/_decomp_update.pyx":845
19312 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
19313 : * c, s.conjugate())
19314 : * return 0 # <<<<<<<<<<<<<<
19315 : *
19316 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF,
19317 : */
19318 154 : __pyx_r = 0;
19319 154 : goto __pyx_L0;
19320 :
19321 : /* "scipy/linalg/_decomp_update.pyx":746
19322 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
19323 : *
19324 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
19325 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
19326 : * cdef int i, j
19327 : */
19328 :
19329 : /* function exit code */
19330 154 : __pyx_L0:;
19331 154 : return __pyx_r;
19332 : }
19333 :
19334 154 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
19335 154 : int __pyx_v_i;
19336 154 : int __pyx_v_j;
19337 154 : double __pyx_v_c;
19338 154 : double __pyx_v_s;
19339 154 : double *__pyx_v_tau;
19340 154 : double *__pyx_v_work;
19341 154 : int __pyx_v_info;
19342 154 : int __pyx_v_lwork;
19343 154 : char *__pyx_v_side;
19344 154 : char *__pyx_v_trans;
19345 154 : int __pyx_r;
19346 154 : int __pyx_t_1;
19347 154 : int __pyx_t_2;
19348 154 : int __pyx_t_3;
19349 154 : int __pyx_t_4;
19350 154 : long __pyx_t_5;
19351 154 : long __pyx_t_6;
19352 154 : int __pyx_t_7;
19353 :
19354 : /* "scipy/linalg/_decomp_update.pyx":750
19355 : * cdef int i, j
19356 : * cdef blas_t c, s
19357 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
19358 : * cdef blas_t* work = NULL
19359 : * cdef int info, lwork
19360 : */
19361 154 : __pyx_v_tau = NULL;
19362 :
19363 : /* "scipy/linalg/_decomp_update.pyx":751
19364 : * cdef blas_t c, s
19365 : * cdef blas_t* tau = NULL
19366 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
19367 : * cdef int info, lwork
19368 : * cdef char* side = 'R'
19369 : */
19370 154 : __pyx_v_work = NULL;
19371 :
19372 : /* "scipy/linalg/_decomp_update.pyx":753
19373 : * cdef blas_t* work = NULL
19374 : * cdef int info, lwork
19375 : * cdef char* side = 'R' # <<<<<<<<<<<<<<
19376 : * cdef char* trans = 'N'
19377 : *
19378 : */
19379 154 : __pyx_v_side = ((char *)"R");
19380 :
19381 : /* "scipy/linalg/_decomp_update.pyx":754
19382 : * cdef int info, lwork
19383 : * cdef char* side = 'R'
19384 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
19385 : *
19386 : * if m >= n:
19387 : */
19388 154 : __pyx_v_trans = ((char *)"N");
19389 :
19390 : /* "scipy/linalg/_decomp_update.pyx":756
19391 : * cdef char* trans = 'N'
19392 : *
19393 : * if m >= n: # <<<<<<<<<<<<<<
19394 : * # if m > n, r looks like this.
19395 : * # x x x x x x x x x x
19396 : */
19397 154 : __pyx_t_1 = (__pyx_v_m >= __pyx_v_n);
19398 154 : if (__pyx_t_1) {
19399 :
19400 : /* "scipy/linalg/_decomp_update.pyx":775
19401 : * # query the workspace,
19402 : * # set tau to point at something to keep new MKL working.
19403 : * tau = &c # <<<<<<<<<<<<<<
19404 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19405 : * if info < 0:
19406 : */
19407 50 : __pyx_v_tau = (&__pyx_v_c);
19408 :
19409 : /* "scipy/linalg/_decomp_update.pyx":776
19410 : * # set tau to point at something to keep new MKL working.
19411 : * tau = &c
19412 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1) # <<<<<<<<<<<<<<
19413 : * if info < 0:
19414 : * return libc.stdlib.abs(info)
19415 : */
19416 50 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
19417 :
19418 : /* "scipy/linalg/_decomp_update.pyx":777
19419 : * tau = &c
19420 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19421 : * if info < 0: # <<<<<<<<<<<<<<
19422 : * return libc.stdlib.abs(info)
19423 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19424 : */
19425 50 : __pyx_t_1 = (__pyx_v_info < 0);
19426 50 : if (__pyx_t_1) {
19427 :
19428 : /* "scipy/linalg/_decomp_update.pyx":778
19429 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19430 : * if info < 0:
19431 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
19432 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19433 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19434 : */
19435 0 : __pyx_r = abs(__pyx_v_info);
19436 0 : goto __pyx_L0;
19437 :
19438 : /* "scipy/linalg/_decomp_update.pyx":777
19439 : * tau = &c
19440 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19441 : * if info < 0: # <<<<<<<<<<<<<<
19442 : * return libc.stdlib.abs(info)
19443 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19444 : */
19445 : }
19446 :
19447 : /* "scipy/linalg/_decomp_update.pyx":779
19448 : * if info < 0:
19449 : * return libc.stdlib.abs(info)
19450 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
19451 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19452 : * if info < 0:
19453 : */
19454 50 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, (&__pyx_v_s), -1);
19455 :
19456 : /* "scipy/linalg/_decomp_update.pyx":781
19457 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19458 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19459 : * if info < 0: # <<<<<<<<<<<<<<
19460 : * return info
19461 : *
19462 : */
19463 50 : __pyx_t_1 = (__pyx_v_info < 0);
19464 50 : if (__pyx_t_1) {
19465 :
19466 : /* "scipy/linalg/_decomp_update.pyx":782
19467 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19468 : * if info < 0:
19469 : * return info # <<<<<<<<<<<<<<
19470 : *
19471 : * # we're only doing one allocation, so use the larger
19472 : */
19473 0 : __pyx_r = __pyx_v_info;
19474 0 : goto __pyx_L0;
19475 :
19476 : /* "scipy/linalg/_decomp_update.pyx":781
19477 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19478 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19479 : * if info < 0: # <<<<<<<<<<<<<<
19480 : * return info
19481 : *
19482 : */
19483 : }
19484 :
19485 : /* "scipy/linalg/_decomp_update.pyx":785
19486 : *
19487 : * # we're only doing one allocation, so use the larger
19488 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
19489 : *
19490 : * # allocate the workspace + tau
19491 : */
19492 50 : __pyx_v_lwork = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
19493 :
19494 : /* "scipy/linalg/_decomp_update.pyx":788
19495 : *
19496 : * # allocate the workspace + tau
19497 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
19498 : * if not work:
19499 : * return MEMORY_ERROR
19500 : */
19501 50 : __pyx_t_2 = __pyx_v_p;
19502 50 : __pyx_t_3 = ((__pyx_v_m - __pyx_v_n) + __pyx_v_p);
19503 50 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
19504 50 : if (__pyx_t_1) {
19505 : __pyx_t_4 = __pyx_t_2;
19506 : } else {
19507 : __pyx_t_4 = __pyx_t_3;
19508 : }
19509 50 : __pyx_v_work = ((double *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(double)))));
19510 :
19511 : /* "scipy/linalg/_decomp_update.pyx":789
19512 : * # allocate the workspace + tau
19513 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
19514 : * if not work: # <<<<<<<<<<<<<<
19515 : * return MEMORY_ERROR
19516 : * tau = work + lwork
19517 : */
19518 50 : __pyx_t_1 = (!(__pyx_v_work != 0));
19519 50 : if (__pyx_t_1) {
19520 :
19521 : /* "scipy/linalg/_decomp_update.pyx":790
19522 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
19523 : * if not work:
19524 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
19525 : * tau = work + lwork
19526 : *
19527 : */
19528 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
19529 0 : goto __pyx_L0;
19530 :
19531 : /* "scipy/linalg/_decomp_update.pyx":789
19532 : * # allocate the workspace + tau
19533 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
19534 : * if not work: # <<<<<<<<<<<<<<
19535 : * return MEMORY_ERROR
19536 : * tau = work + lwork
19537 : */
19538 : }
19539 :
19540 : /* "scipy/linalg/_decomp_update.pyx":791
19541 : * if not work:
19542 : * return MEMORY_ERROR
19543 : * tau = work + lwork # <<<<<<<<<<<<<<
19544 : *
19545 : * # qr
19546 : */
19547 50 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
19548 :
19549 : /* "scipy/linalg/_decomp_update.pyx":794
19550 : *
19551 : * # qr
19552 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork) # <<<<<<<<<<<<<<
19553 : * if info < 0:
19554 : * return libc.stdlib.abs(info)
19555 : */
19556 50 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
19557 :
19558 : /* "scipy/linalg/_decomp_update.pyx":795
19559 : * # qr
19560 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
19561 : * if info < 0: # <<<<<<<<<<<<<<
19562 : * return libc.stdlib.abs(info)
19563 : *
19564 : */
19565 50 : __pyx_t_1 = (__pyx_v_info < 0);
19566 50 : if (__pyx_t_1) {
19567 :
19568 : /* "scipy/linalg/_decomp_update.pyx":796
19569 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
19570 : * if info < 0:
19571 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
19572 : *
19573 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
19574 : */
19575 0 : __pyx_r = abs(__pyx_v_info);
19576 0 : goto __pyx_L0;
19577 :
19578 : /* "scipy/linalg/_decomp_update.pyx":795
19579 : * # qr
19580 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
19581 : * if info < 0: # <<<<<<<<<<<<<<
19582 : * return libc.stdlib.abs(info)
19583 : *
19584 : */
19585 : }
19586 :
19587 : /* "scipy/linalg/_decomp_update.pyx":799
19588 : *
19589 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
19590 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
19591 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19592 : * if info < 0:
19593 : */
19594 50 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
19595 :
19596 : /* "scipy/linalg/_decomp_update.pyx":801
19597 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19598 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19599 : * if info < 0: # <<<<<<<<<<<<<<
19600 : * return info
19601 : *
19602 : */
19603 50 : __pyx_t_1 = (__pyx_v_info < 0);
19604 50 : if (__pyx_t_1) {
19605 :
19606 : /* "scipy/linalg/_decomp_update.pyx":802
19607 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19608 : * if info < 0:
19609 : * return info # <<<<<<<<<<<<<<
19610 : *
19611 : * libc.stdlib.free(work)
19612 : */
19613 0 : __pyx_r = __pyx_v_info;
19614 0 : goto __pyx_L0;
19615 :
19616 : /* "scipy/linalg/_decomp_update.pyx":801
19617 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19618 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
19619 : * if info < 0: # <<<<<<<<<<<<<<
19620 : * return info
19621 : *
19622 : */
19623 : }
19624 :
19625 : /* "scipy/linalg/_decomp_update.pyx":804
19626 : * return info
19627 : *
19628 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
19629 : *
19630 : * # zero the reflectors since we're done with them
19631 : */
19632 50 : free(__pyx_v_work);
19633 :
19634 : /* "scipy/linalg/_decomp_update.pyx":808
19635 : * # zero the reflectors since we're done with them
19636 : * # memset can be used here, since r is always fortran order
19637 : * for j in range(p): # <<<<<<<<<<<<<<
19638 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t))
19639 : *
19640 : */
19641 50 : __pyx_t_4 = __pyx_v_p;
19642 50 : __pyx_t_2 = __pyx_t_4;
19643 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19644 166 : __pyx_v_j = __pyx_t_3;
19645 :
19646 : /* "scipy/linalg/_decomp_update.pyx":809
19647 : * # memset can be used here, since r is always fortran order
19648 : * for j in range(p):
19649 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t)) # <<<<<<<<<<<<<<
19650 : *
19651 : * # now we have something that looks like
19652 : */
19653 166 : (void)(memset(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), 0, ((__pyx_v_m - (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j)) * (sizeof(double)))));
19654 : }
19655 :
19656 : /* "scipy/linalg/_decomp_update.pyx":827
19657 : * # and the rest of the columns need to be eliminated using rotations.
19658 : *
19659 : * for i in range(p): # <<<<<<<<<<<<<<
19660 : * for j in range(n-p+i-1, k+i-1, -1):
19661 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19662 : */
19663 216 : __pyx_t_4 = __pyx_v_p;
19664 216 : __pyx_t_2 = __pyx_t_4;
19665 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19666 166 : __pyx_v_i = __pyx_t_3;
19667 :
19668 : /* "scipy/linalg/_decomp_update.pyx":828
19669 : *
19670 : * for i in range(p):
19671 : * for j in range(n-p+i-1, k+i-1, -1): # <<<<<<<<<<<<<<
19672 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19673 : * if j+1 < n:
19674 : */
19675 166 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
19676 166 : __pyx_t_6 = __pyx_t_5;
19677 1065 : for (__pyx_t_7 = (((__pyx_v_n - __pyx_v_p) + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
19678 899 : __pyx_v_j = __pyx_t_7;
19679 :
19680 : /* "scipy/linalg/_decomp_update.pyx":829
19681 : * for i in range(p):
19682 : * for j in range(n-p+i-1, k+i-1, -1):
19683 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
19684 : * if j+1 < n:
19685 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19686 : */
19687 899 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
19688 :
19689 : /* "scipy/linalg/_decomp_update.pyx":830
19690 : * for j in range(n-p+i-1, k+i-1, -1):
19691 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19692 : * if j+1 < n: # <<<<<<<<<<<<<<
19693 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19694 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19695 : */
19696 899 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
19697 899 : if (__pyx_t_1) {
19698 :
19699 : /* "scipy/linalg/_decomp_update.pyx":831
19700 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19701 : * if j+1 < n:
19702 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
19703 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19704 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
19705 : */
19706 899 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
19707 :
19708 : /* "scipy/linalg/_decomp_update.pyx":830
19709 : * for j in range(n-p+i-1, k+i-1, -1):
19710 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19711 : * if j+1 < n: # <<<<<<<<<<<<<<
19712 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19713 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19714 : */
19715 : }
19716 :
19717 : /* "scipy/linalg/_decomp_update.pyx":833
19718 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19719 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19720 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
19721 : * c, s.conjugate())
19722 : * else:
19723 : */
19724 899 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
19725 : }
19726 : }
19727 :
19728 : /* "scipy/linalg/_decomp_update.pyx":756
19729 : * cdef char* trans = 'N'
19730 : *
19731 : * if m >= n: # <<<<<<<<<<<<<<
19732 : * # if m > n, r looks like this.
19733 : * # x x x x x x x x x x
19734 : */
19735 50 : goto __pyx_L3;
19736 : }
19737 :
19738 : /* "scipy/linalg/_decomp_update.pyx":837
19739 : * else:
19740 : * # this case we can only uses givens rotations.
19741 : * for i in range(p): # <<<<<<<<<<<<<<
19742 : * for j in range(m-2, k+i-1, -1):
19743 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19744 : */
19745 : /*else*/ {
19746 440 : __pyx_t_4 = __pyx_v_p;
19747 440 : __pyx_t_2 = __pyx_t_4;
19748 440 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19749 336 : __pyx_v_i = __pyx_t_3;
19750 :
19751 : /* "scipy/linalg/_decomp_update.pyx":838
19752 : * # this case we can only uses givens rotations.
19753 : * for i in range(p):
19754 : * for j in range(m-2, k+i-1, -1): # <<<<<<<<<<<<<<
19755 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19756 : * if j+1 < n:
19757 : */
19758 336 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
19759 336 : __pyx_t_6 = __pyx_t_5;
19760 1830 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
19761 1494 : __pyx_v_j = __pyx_t_7;
19762 :
19763 : /* "scipy/linalg/_decomp_update.pyx":839
19764 : * for i in range(p):
19765 : * for j in range(m-2, k+i-1, -1):
19766 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
19767 : * if j+1 < n:
19768 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19769 : */
19770 1494 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
19771 :
19772 : /* "scipy/linalg/_decomp_update.pyx":840
19773 : * for j in range(m-2, k+i-1, -1):
19774 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19775 : * if j+1 < n: # <<<<<<<<<<<<<<
19776 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19777 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19778 : */
19779 1494 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
19780 1494 : if (__pyx_t_1) {
19781 :
19782 : /* "scipy/linalg/_decomp_update.pyx":841
19783 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19784 : * if j+1 < n:
19785 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
19786 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19787 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
19788 : */
19789 1494 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
19790 :
19791 : /* "scipy/linalg/_decomp_update.pyx":840
19792 : * for j in range(m-2, k+i-1, -1):
19793 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
19794 : * if j+1 < n: # <<<<<<<<<<<<<<
19795 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19796 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19797 : */
19798 : }
19799 :
19800 : /* "scipy/linalg/_decomp_update.pyx":843
19801 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
19802 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
19803 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
19804 : * c, s.conjugate())
19805 : * return 0
19806 : */
19807 1494 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
19808 : }
19809 : }
19810 : }
19811 104 : __pyx_L3:;
19812 :
19813 : /* "scipy/linalg/_decomp_update.pyx":845
19814 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
19815 : * c, s.conjugate())
19816 : * return 0 # <<<<<<<<<<<<<<
19817 : *
19818 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF,
19819 : */
19820 154 : __pyx_r = 0;
19821 154 : goto __pyx_L0;
19822 :
19823 : /* "scipy/linalg/_decomp_update.pyx":746
19824 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
19825 : *
19826 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
19827 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
19828 : * cdef int i, j
19829 : */
19830 :
19831 : /* function exit code */
19832 154 : __pyx_L0:;
19833 154 : return __pyx_r;
19834 : }
19835 :
19836 154 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
19837 154 : int __pyx_v_i;
19838 154 : int __pyx_v_j;
19839 154 : __pyx_t_float_complex __pyx_v_c;
19840 154 : __pyx_t_float_complex __pyx_v_s;
19841 154 : __pyx_t_float_complex *__pyx_v_tau;
19842 154 : __pyx_t_float_complex *__pyx_v_work;
19843 154 : int __pyx_v_info;
19844 154 : int __pyx_v_lwork;
19845 154 : char *__pyx_v_side;
19846 154 : char *__pyx_v_trans;
19847 154 : int __pyx_r;
19848 154 : int __pyx_t_1;
19849 154 : int __pyx_t_2;
19850 154 : int __pyx_t_3;
19851 154 : int __pyx_t_4;
19852 154 : long __pyx_t_5;
19853 154 : long __pyx_t_6;
19854 154 : int __pyx_t_7;
19855 :
19856 : /* "scipy/linalg/_decomp_update.pyx":750
19857 : * cdef int i, j
19858 : * cdef blas_t c, s
19859 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
19860 : * cdef blas_t* work = NULL
19861 : * cdef int info, lwork
19862 : */
19863 154 : __pyx_v_tau = NULL;
19864 :
19865 : /* "scipy/linalg/_decomp_update.pyx":751
19866 : * cdef blas_t c, s
19867 : * cdef blas_t* tau = NULL
19868 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
19869 : * cdef int info, lwork
19870 : * cdef char* side = 'R'
19871 : */
19872 154 : __pyx_v_work = NULL;
19873 :
19874 : /* "scipy/linalg/_decomp_update.pyx":753
19875 : * cdef blas_t* work = NULL
19876 : * cdef int info, lwork
19877 : * cdef char* side = 'R' # <<<<<<<<<<<<<<
19878 : * cdef char* trans = 'N'
19879 : *
19880 : */
19881 154 : __pyx_v_side = ((char *)"R");
19882 :
19883 : /* "scipy/linalg/_decomp_update.pyx":754
19884 : * cdef int info, lwork
19885 : * cdef char* side = 'R'
19886 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
19887 : *
19888 : * if m >= n:
19889 : */
19890 154 : __pyx_v_trans = ((char *)"N");
19891 :
19892 : /* "scipy/linalg/_decomp_update.pyx":756
19893 : * cdef char* trans = 'N'
19894 : *
19895 : * if m >= n: # <<<<<<<<<<<<<<
19896 : * # if m > n, r looks like this.
19897 : * # x x x x x x x x x x
19898 : */
19899 154 : __pyx_t_1 = (__pyx_v_m >= __pyx_v_n);
19900 154 : if (__pyx_t_1) {
19901 :
19902 : /* "scipy/linalg/_decomp_update.pyx":775
19903 : * # query the workspace,
19904 : * # set tau to point at something to keep new MKL working.
19905 : * tau = &c # <<<<<<<<<<<<<<
19906 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19907 : * if info < 0:
19908 : */
19909 50 : __pyx_v_tau = (&__pyx_v_c);
19910 :
19911 : /* "scipy/linalg/_decomp_update.pyx":776
19912 : * # set tau to point at something to keep new MKL working.
19913 : * tau = &c
19914 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1) # <<<<<<<<<<<<<<
19915 : * if info < 0:
19916 : * return libc.stdlib.abs(info)
19917 : */
19918 50 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
19919 :
19920 : /* "scipy/linalg/_decomp_update.pyx":777
19921 : * tau = &c
19922 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19923 : * if info < 0: # <<<<<<<<<<<<<<
19924 : * return libc.stdlib.abs(info)
19925 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19926 : */
19927 50 : __pyx_t_1 = (__pyx_v_info < 0);
19928 50 : if (__pyx_t_1) {
19929 :
19930 : /* "scipy/linalg/_decomp_update.pyx":778
19931 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19932 : * if info < 0:
19933 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
19934 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19935 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19936 : */
19937 0 : __pyx_r = abs(__pyx_v_info);
19938 0 : goto __pyx_L0;
19939 :
19940 : /* "scipy/linalg/_decomp_update.pyx":777
19941 : * tau = &c
19942 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
19943 : * if info < 0: # <<<<<<<<<<<<<<
19944 : * return libc.stdlib.abs(info)
19945 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19946 : */
19947 : }
19948 :
19949 : /* "scipy/linalg/_decomp_update.pyx":779
19950 : * if info < 0:
19951 : * return libc.stdlib.abs(info)
19952 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
19953 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19954 : * if info < 0:
19955 : */
19956 50 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, (&__pyx_v_s), -1);
19957 :
19958 : /* "scipy/linalg/_decomp_update.pyx":781
19959 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19960 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19961 : * if info < 0: # <<<<<<<<<<<<<<
19962 : * return info
19963 : *
19964 : */
19965 50 : __pyx_t_1 = (__pyx_v_info < 0);
19966 50 : if (__pyx_t_1) {
19967 :
19968 : /* "scipy/linalg/_decomp_update.pyx":782
19969 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19970 : * if info < 0:
19971 : * return info # <<<<<<<<<<<<<<
19972 : *
19973 : * # we're only doing one allocation, so use the larger
19974 : */
19975 0 : __pyx_r = __pyx_v_info;
19976 0 : goto __pyx_L0;
19977 :
19978 : /* "scipy/linalg/_decomp_update.pyx":781
19979 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
19980 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
19981 : * if info < 0: # <<<<<<<<<<<<<<
19982 : * return info
19983 : *
19984 : */
19985 : }
19986 :
19987 : /* "scipy/linalg/_decomp_update.pyx":785
19988 : *
19989 : * # we're only doing one allocation, so use the larger
19990 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
19991 : *
19992 : * # allocate the workspace + tau
19993 : */
19994 50 : __pyx_v_lwork = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
19995 :
19996 : /* "scipy/linalg/_decomp_update.pyx":788
19997 : *
19998 : * # allocate the workspace + tau
19999 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
20000 : * if not work:
20001 : * return MEMORY_ERROR
20002 : */
20003 50 : __pyx_t_2 = __pyx_v_p;
20004 50 : __pyx_t_3 = ((__pyx_v_m - __pyx_v_n) + __pyx_v_p);
20005 50 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
20006 50 : if (__pyx_t_1) {
20007 : __pyx_t_4 = __pyx_t_2;
20008 : } else {
20009 : __pyx_t_4 = __pyx_t_3;
20010 : }
20011 50 : __pyx_v_work = ((__pyx_t_float_complex *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(__pyx_t_float_complex)))));
20012 :
20013 : /* "scipy/linalg/_decomp_update.pyx":789
20014 : * # allocate the workspace + tau
20015 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
20016 : * if not work: # <<<<<<<<<<<<<<
20017 : * return MEMORY_ERROR
20018 : * tau = work + lwork
20019 : */
20020 50 : __pyx_t_1 = (!(__pyx_v_work != 0));
20021 50 : if (__pyx_t_1) {
20022 :
20023 : /* "scipy/linalg/_decomp_update.pyx":790
20024 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
20025 : * if not work:
20026 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
20027 : * tau = work + lwork
20028 : *
20029 : */
20030 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
20031 0 : goto __pyx_L0;
20032 :
20033 : /* "scipy/linalg/_decomp_update.pyx":789
20034 : * # allocate the workspace + tau
20035 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
20036 : * if not work: # <<<<<<<<<<<<<<
20037 : * return MEMORY_ERROR
20038 : * tau = work + lwork
20039 : */
20040 : }
20041 :
20042 : /* "scipy/linalg/_decomp_update.pyx":791
20043 : * if not work:
20044 : * return MEMORY_ERROR
20045 : * tau = work + lwork # <<<<<<<<<<<<<<
20046 : *
20047 : * # qr
20048 : */
20049 50 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
20050 :
20051 : /* "scipy/linalg/_decomp_update.pyx":794
20052 : *
20053 : * # qr
20054 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork) # <<<<<<<<<<<<<<
20055 : * if info < 0:
20056 : * return libc.stdlib.abs(info)
20057 : */
20058 50 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
20059 :
20060 : /* "scipy/linalg/_decomp_update.pyx":795
20061 : * # qr
20062 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
20063 : * if info < 0: # <<<<<<<<<<<<<<
20064 : * return libc.stdlib.abs(info)
20065 : *
20066 : */
20067 50 : __pyx_t_1 = (__pyx_v_info < 0);
20068 50 : if (__pyx_t_1) {
20069 :
20070 : /* "scipy/linalg/_decomp_update.pyx":796
20071 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
20072 : * if info < 0:
20073 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
20074 : *
20075 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
20076 : */
20077 0 : __pyx_r = abs(__pyx_v_info);
20078 0 : goto __pyx_L0;
20079 :
20080 : /* "scipy/linalg/_decomp_update.pyx":795
20081 : * # qr
20082 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
20083 : * if info < 0: # <<<<<<<<<<<<<<
20084 : * return libc.stdlib.abs(info)
20085 : *
20086 : */
20087 : }
20088 :
20089 : /* "scipy/linalg/_decomp_update.pyx":799
20090 : *
20091 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
20092 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
20093 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20094 : * if info < 0:
20095 : */
20096 50 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
20097 :
20098 : /* "scipy/linalg/_decomp_update.pyx":801
20099 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20100 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20101 : * if info < 0: # <<<<<<<<<<<<<<
20102 : * return info
20103 : *
20104 : */
20105 50 : __pyx_t_1 = (__pyx_v_info < 0);
20106 50 : if (__pyx_t_1) {
20107 :
20108 : /* "scipy/linalg/_decomp_update.pyx":802
20109 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20110 : * if info < 0:
20111 : * return info # <<<<<<<<<<<<<<
20112 : *
20113 : * libc.stdlib.free(work)
20114 : */
20115 0 : __pyx_r = __pyx_v_info;
20116 0 : goto __pyx_L0;
20117 :
20118 : /* "scipy/linalg/_decomp_update.pyx":801
20119 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20120 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20121 : * if info < 0: # <<<<<<<<<<<<<<
20122 : * return info
20123 : *
20124 : */
20125 : }
20126 :
20127 : /* "scipy/linalg/_decomp_update.pyx":804
20128 : * return info
20129 : *
20130 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
20131 : *
20132 : * # zero the reflectors since we're done with them
20133 : */
20134 50 : free(__pyx_v_work);
20135 :
20136 : /* "scipy/linalg/_decomp_update.pyx":808
20137 : * # zero the reflectors since we're done with them
20138 : * # memset can be used here, since r is always fortran order
20139 : * for j in range(p): # <<<<<<<<<<<<<<
20140 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t))
20141 : *
20142 : */
20143 50 : __pyx_t_4 = __pyx_v_p;
20144 50 : __pyx_t_2 = __pyx_t_4;
20145 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20146 166 : __pyx_v_j = __pyx_t_3;
20147 :
20148 : /* "scipy/linalg/_decomp_update.pyx":809
20149 : * # memset can be used here, since r is always fortran order
20150 : * for j in range(p):
20151 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t)) # <<<<<<<<<<<<<<
20152 : *
20153 : * # now we have something that looks like
20154 : */
20155 166 : (void)(memset(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), 0, ((__pyx_v_m - (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j)) * (sizeof(__pyx_t_float_complex)))));
20156 : }
20157 :
20158 : /* "scipy/linalg/_decomp_update.pyx":827
20159 : * # and the rest of the columns need to be eliminated using rotations.
20160 : *
20161 : * for i in range(p): # <<<<<<<<<<<<<<
20162 : * for j in range(n-p+i-1, k+i-1, -1):
20163 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20164 : */
20165 216 : __pyx_t_4 = __pyx_v_p;
20166 216 : __pyx_t_2 = __pyx_t_4;
20167 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20168 166 : __pyx_v_i = __pyx_t_3;
20169 :
20170 : /* "scipy/linalg/_decomp_update.pyx":828
20171 : *
20172 : * for i in range(p):
20173 : * for j in range(n-p+i-1, k+i-1, -1): # <<<<<<<<<<<<<<
20174 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20175 : * if j+1 < n:
20176 : */
20177 166 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
20178 166 : __pyx_t_6 = __pyx_t_5;
20179 1065 : for (__pyx_t_7 = (((__pyx_v_n - __pyx_v_p) + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
20180 899 : __pyx_v_j = __pyx_t_7;
20181 :
20182 : /* "scipy/linalg/_decomp_update.pyx":829
20183 : * for i in range(p):
20184 : * for j in range(n-p+i-1, k+i-1, -1):
20185 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
20186 : * if j+1 < n:
20187 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20188 : */
20189 899 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
20190 :
20191 : /* "scipy/linalg/_decomp_update.pyx":830
20192 : * for j in range(n-p+i-1, k+i-1, -1):
20193 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20194 : * if j+1 < n: # <<<<<<<<<<<<<<
20195 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20196 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20197 : */
20198 899 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
20199 899 : if (__pyx_t_1) {
20200 :
20201 : /* "scipy/linalg/_decomp_update.pyx":831
20202 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20203 : * if j+1 < n:
20204 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
20205 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20206 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
20207 : */
20208 899 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
20209 :
20210 : /* "scipy/linalg/_decomp_update.pyx":830
20211 : * for j in range(n-p+i-1, k+i-1, -1):
20212 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20213 : * if j+1 < n: # <<<<<<<<<<<<<<
20214 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20215 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20216 : */
20217 : }
20218 :
20219 : /* "scipy/linalg/_decomp_update.pyx":833
20220 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20221 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20222 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
20223 : * c, s.conjugate())
20224 : * else:
20225 : */
20226 899 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
20227 : }
20228 : }
20229 :
20230 : /* "scipy/linalg/_decomp_update.pyx":756
20231 : * cdef char* trans = 'N'
20232 : *
20233 : * if m >= n: # <<<<<<<<<<<<<<
20234 : * # if m > n, r looks like this.
20235 : * # x x x x x x x x x x
20236 : */
20237 50 : goto __pyx_L3;
20238 : }
20239 :
20240 : /* "scipy/linalg/_decomp_update.pyx":837
20241 : * else:
20242 : * # this case we can only uses givens rotations.
20243 : * for i in range(p): # <<<<<<<<<<<<<<
20244 : * for j in range(m-2, k+i-1, -1):
20245 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20246 : */
20247 : /*else*/ {
20248 440 : __pyx_t_4 = __pyx_v_p;
20249 440 : __pyx_t_2 = __pyx_t_4;
20250 440 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20251 336 : __pyx_v_i = __pyx_t_3;
20252 :
20253 : /* "scipy/linalg/_decomp_update.pyx":838
20254 : * # this case we can only uses givens rotations.
20255 : * for i in range(p):
20256 : * for j in range(m-2, k+i-1, -1): # <<<<<<<<<<<<<<
20257 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20258 : * if j+1 < n:
20259 : */
20260 336 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
20261 336 : __pyx_t_6 = __pyx_t_5;
20262 1830 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
20263 1494 : __pyx_v_j = __pyx_t_7;
20264 :
20265 : /* "scipy/linalg/_decomp_update.pyx":839
20266 : * for i in range(p):
20267 : * for j in range(m-2, k+i-1, -1):
20268 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
20269 : * if j+1 < n:
20270 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20271 : */
20272 1494 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
20273 :
20274 : /* "scipy/linalg/_decomp_update.pyx":840
20275 : * for j in range(m-2, k+i-1, -1):
20276 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20277 : * if j+1 < n: # <<<<<<<<<<<<<<
20278 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20279 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20280 : */
20281 1494 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
20282 1494 : if (__pyx_t_1) {
20283 :
20284 : /* "scipy/linalg/_decomp_update.pyx":841
20285 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20286 : * if j+1 < n:
20287 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
20288 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20289 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
20290 : */
20291 1494 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
20292 :
20293 : /* "scipy/linalg/_decomp_update.pyx":840
20294 : * for j in range(m-2, k+i-1, -1):
20295 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20296 : * if j+1 < n: # <<<<<<<<<<<<<<
20297 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20298 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20299 : */
20300 : }
20301 :
20302 : /* "scipy/linalg/_decomp_update.pyx":843
20303 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20304 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20305 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
20306 : * c, s.conjugate())
20307 : * return 0
20308 : */
20309 1494 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
20310 : }
20311 : }
20312 : }
20313 104 : __pyx_L3:;
20314 :
20315 : /* "scipy/linalg/_decomp_update.pyx":845
20316 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
20317 : * c, s.conjugate())
20318 : * return 0 # <<<<<<<<<<<<<<
20319 : *
20320 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF,
20321 : */
20322 154 : __pyx_r = 0;
20323 154 : goto __pyx_L0;
20324 :
20325 : /* "scipy/linalg/_decomp_update.pyx":746
20326 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
20327 : *
20328 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
20329 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
20330 : * cdef int i, j
20331 : */
20332 :
20333 : /* function exit code */
20334 154 : __pyx_L0:;
20335 154 : return __pyx_r;
20336 : }
20337 :
20338 154 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p) {
20339 154 : int __pyx_v_i;
20340 154 : int __pyx_v_j;
20341 154 : __pyx_t_double_complex __pyx_v_c;
20342 154 : __pyx_t_double_complex __pyx_v_s;
20343 154 : __pyx_t_double_complex *__pyx_v_tau;
20344 154 : __pyx_t_double_complex *__pyx_v_work;
20345 154 : int __pyx_v_info;
20346 154 : int __pyx_v_lwork;
20347 154 : char *__pyx_v_side;
20348 154 : char *__pyx_v_trans;
20349 154 : int __pyx_r;
20350 154 : int __pyx_t_1;
20351 154 : int __pyx_t_2;
20352 154 : int __pyx_t_3;
20353 154 : int __pyx_t_4;
20354 154 : long __pyx_t_5;
20355 154 : long __pyx_t_6;
20356 154 : int __pyx_t_7;
20357 :
20358 : /* "scipy/linalg/_decomp_update.pyx":750
20359 : * cdef int i, j
20360 : * cdef blas_t c, s
20361 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
20362 : * cdef blas_t* work = NULL
20363 : * cdef int info, lwork
20364 : */
20365 154 : __pyx_v_tau = NULL;
20366 :
20367 : /* "scipy/linalg/_decomp_update.pyx":751
20368 : * cdef blas_t c, s
20369 : * cdef blas_t* tau = NULL
20370 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
20371 : * cdef int info, lwork
20372 : * cdef char* side = 'R'
20373 : */
20374 154 : __pyx_v_work = NULL;
20375 :
20376 : /* "scipy/linalg/_decomp_update.pyx":753
20377 : * cdef blas_t* work = NULL
20378 : * cdef int info, lwork
20379 : * cdef char* side = 'R' # <<<<<<<<<<<<<<
20380 : * cdef char* trans = 'N'
20381 : *
20382 : */
20383 154 : __pyx_v_side = ((char *)"R");
20384 :
20385 : /* "scipy/linalg/_decomp_update.pyx":754
20386 : * cdef int info, lwork
20387 : * cdef char* side = 'R'
20388 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
20389 : *
20390 : * if m >= n:
20391 : */
20392 154 : __pyx_v_trans = ((char *)"N");
20393 :
20394 : /* "scipy/linalg/_decomp_update.pyx":756
20395 : * cdef char* trans = 'N'
20396 : *
20397 : * if m >= n: # <<<<<<<<<<<<<<
20398 : * # if m > n, r looks like this.
20399 : * # x x x x x x x x x x
20400 : */
20401 154 : __pyx_t_1 = (__pyx_v_m >= __pyx_v_n);
20402 154 : if (__pyx_t_1) {
20403 :
20404 : /* "scipy/linalg/_decomp_update.pyx":775
20405 : * # query the workspace,
20406 : * # set tau to point at something to keep new MKL working.
20407 : * tau = &c # <<<<<<<<<<<<<<
20408 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
20409 : * if info < 0:
20410 : */
20411 50 : __pyx_v_tau = (&__pyx_v_c);
20412 :
20413 : /* "scipy/linalg/_decomp_update.pyx":776
20414 : * # set tau to point at something to keep new MKL working.
20415 : * tau = &c
20416 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1) # <<<<<<<<<<<<<<
20417 : * if info < 0:
20418 : * return libc.stdlib.abs(info)
20419 : */
20420 50 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
20421 :
20422 : /* "scipy/linalg/_decomp_update.pyx":777
20423 : * tau = &c
20424 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
20425 : * if info < 0: # <<<<<<<<<<<<<<
20426 : * return libc.stdlib.abs(info)
20427 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20428 : */
20429 50 : __pyx_t_1 = (__pyx_v_info < 0);
20430 50 : if (__pyx_t_1) {
20431 :
20432 : /* "scipy/linalg/_decomp_update.pyx":778
20433 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
20434 : * if info < 0:
20435 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
20436 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20437 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
20438 : */
20439 0 : __pyx_r = abs(__pyx_v_info);
20440 0 : goto __pyx_L0;
20441 :
20442 : /* "scipy/linalg/_decomp_update.pyx":777
20443 : * tau = &c
20444 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, &c, -1)
20445 : * if info < 0: # <<<<<<<<<<<<<<
20446 : * return libc.stdlib.abs(info)
20447 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20448 : */
20449 : }
20450 :
20451 : /* "scipy/linalg/_decomp_update.pyx":779
20452 : * if info < 0:
20453 : * return libc.stdlib.abs(info)
20454 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
20455 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
20456 : * if info < 0:
20457 : */
20458 50 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, (&__pyx_v_s), -1);
20459 :
20460 : /* "scipy/linalg/_decomp_update.pyx":781
20461 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20462 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
20463 : * if info < 0: # <<<<<<<<<<<<<<
20464 : * return info
20465 : *
20466 : */
20467 50 : __pyx_t_1 = (__pyx_v_info < 0);
20468 50 : if (__pyx_t_1) {
20469 :
20470 : /* "scipy/linalg/_decomp_update.pyx":782
20471 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
20472 : * if info < 0:
20473 : * return info # <<<<<<<<<<<<<<
20474 : *
20475 : * # we're only doing one allocation, so use the larger
20476 : */
20477 0 : __pyx_r = __pyx_v_info;
20478 0 : goto __pyx_L0;
20479 :
20480 : /* "scipy/linalg/_decomp_update.pyx":781
20481 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20482 : * tau, index2(q, qs, 0, n-p), m, &s, -1)
20483 : * if info < 0: # <<<<<<<<<<<<<<
20484 : * return info
20485 : *
20486 : */
20487 : }
20488 :
20489 : /* "scipy/linalg/_decomp_update.pyx":785
20490 : *
20491 : * # we're only doing one allocation, so use the larger
20492 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
20493 : *
20494 : * # allocate the workspace + tau
20495 : */
20496 50 : __pyx_v_lwork = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
20497 :
20498 : /* "scipy/linalg/_decomp_update.pyx":788
20499 : *
20500 : * # allocate the workspace + tau
20501 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
20502 : * if not work:
20503 : * return MEMORY_ERROR
20504 : */
20505 50 : __pyx_t_2 = __pyx_v_p;
20506 50 : __pyx_t_3 = ((__pyx_v_m - __pyx_v_n) + __pyx_v_p);
20507 50 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
20508 50 : if (__pyx_t_1) {
20509 : __pyx_t_4 = __pyx_t_2;
20510 : } else {
20511 : __pyx_t_4 = __pyx_t_3;
20512 : }
20513 50 : __pyx_v_work = ((__pyx_t_double_complex *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(__pyx_t_double_complex)))));
20514 :
20515 : /* "scipy/linalg/_decomp_update.pyx":789
20516 : * # allocate the workspace + tau
20517 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
20518 : * if not work: # <<<<<<<<<<<<<<
20519 : * return MEMORY_ERROR
20520 : * tau = work + lwork
20521 : */
20522 50 : __pyx_t_1 = (!(__pyx_v_work != 0));
20523 50 : if (__pyx_t_1) {
20524 :
20525 : /* "scipy/linalg/_decomp_update.pyx":790
20526 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
20527 : * if not work:
20528 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
20529 : * tau = work + lwork
20530 : *
20531 : */
20532 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
20533 0 : goto __pyx_L0;
20534 :
20535 : /* "scipy/linalg/_decomp_update.pyx":789
20536 : * # allocate the workspace + tau
20537 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n+p, p))*sizeof(blas_t))
20538 : * if not work: # <<<<<<<<<<<<<<
20539 : * return MEMORY_ERROR
20540 : * tau = work + lwork
20541 : */
20542 : }
20543 :
20544 : /* "scipy/linalg/_decomp_update.pyx":791
20545 : * if not work:
20546 : * return MEMORY_ERROR
20547 : * tau = work + lwork # <<<<<<<<<<<<<<
20548 : *
20549 : * # qr
20550 : */
20551 50 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
20552 :
20553 : /* "scipy/linalg/_decomp_update.pyx":794
20554 : *
20555 : * # qr
20556 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork) # <<<<<<<<<<<<<<
20557 : * if info < 0:
20558 : * return libc.stdlib.abs(info)
20559 : */
20560 50 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_geqrf(((__pyx_v_m - __pyx_v_n) + __pyx_v_p), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
20561 :
20562 : /* "scipy/linalg/_decomp_update.pyx":795
20563 : * # qr
20564 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
20565 : * if info < 0: # <<<<<<<<<<<<<<
20566 : * return libc.stdlib.abs(info)
20567 : *
20568 : */
20569 50 : __pyx_t_1 = (__pyx_v_info < 0);
20570 50 : if (__pyx_t_1) {
20571 :
20572 : /* "scipy/linalg/_decomp_update.pyx":796
20573 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
20574 : * if info < 0:
20575 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
20576 : *
20577 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
20578 : */
20579 0 : __pyx_r = abs(__pyx_v_info);
20580 0 : goto __pyx_L0;
20581 :
20582 : /* "scipy/linalg/_decomp_update.pyx":795
20583 : * # qr
20584 : * info = geqrf(m-n+p, p, index2(r, rs, n-p, k), m, tau, work, lwork)
20585 : * if info < 0: # <<<<<<<<<<<<<<
20586 : * return libc.stdlib.abs(info)
20587 : *
20588 : */
20589 : }
20590 :
20591 : /* "scipy/linalg/_decomp_update.pyx":799
20592 : *
20593 : * # apply the Q from this small qr to the last (m-(n-p)) columns of q.
20594 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m, # <<<<<<<<<<<<<<
20595 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20596 : * if info < 0:
20597 : */
20598 50 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_side, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - (__pyx_v_n - __pyx_v_p)), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - __pyx_v_p), __pyx_v_k), __pyx_v_m, __pyx_v_tau, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, (__pyx_v_n - __pyx_v_p)), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
20599 :
20600 : /* "scipy/linalg/_decomp_update.pyx":801
20601 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20602 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20603 : * if info < 0: # <<<<<<<<<<<<<<
20604 : * return info
20605 : *
20606 : */
20607 50 : __pyx_t_1 = (__pyx_v_info < 0);
20608 50 : if (__pyx_t_1) {
20609 :
20610 : /* "scipy/linalg/_decomp_update.pyx":802
20611 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20612 : * if info < 0:
20613 : * return info # <<<<<<<<<<<<<<
20614 : *
20615 : * libc.stdlib.free(work)
20616 : */
20617 0 : __pyx_r = __pyx_v_info;
20618 0 : goto __pyx_L0;
20619 :
20620 : /* "scipy/linalg/_decomp_update.pyx":801
20621 : * info = ormqr(side, trans, m, m-(n-p), p, index2(r, rs, n-p, k), m,
20622 : * tau, index2(q, qs, 0, n-p), m, work, lwork)
20623 : * if info < 0: # <<<<<<<<<<<<<<
20624 : * return info
20625 : *
20626 : */
20627 : }
20628 :
20629 : /* "scipy/linalg/_decomp_update.pyx":804
20630 : * return info
20631 : *
20632 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
20633 : *
20634 : * # zero the reflectors since we're done with them
20635 : */
20636 50 : free(__pyx_v_work);
20637 :
20638 : /* "scipy/linalg/_decomp_update.pyx":808
20639 : * # zero the reflectors since we're done with them
20640 : * # memset can be used here, since r is always fortran order
20641 : * for j in range(p): # <<<<<<<<<<<<<<
20642 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t))
20643 : *
20644 : */
20645 50 : __pyx_t_4 = __pyx_v_p;
20646 50 : __pyx_t_2 = __pyx_t_4;
20647 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20648 166 : __pyx_v_j = __pyx_t_3;
20649 :
20650 : /* "scipy/linalg/_decomp_update.pyx":809
20651 : * # memset can be used here, since r is always fortran order
20652 : * for j in range(p):
20653 : * memset(index2(r, rs, n-p+1+j, k+j), 0, (m-(n-p+1+j))*sizeof(blas_t)) # <<<<<<<<<<<<<<
20654 : *
20655 : * # now we have something that looks like
20656 : */
20657 166 : (void)(memset(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j), (__pyx_v_k + __pyx_v_j)), 0, ((__pyx_v_m - (((__pyx_v_n - __pyx_v_p) + 1) + __pyx_v_j)) * (sizeof(__pyx_t_double_complex)))));
20658 : }
20659 :
20660 : /* "scipy/linalg/_decomp_update.pyx":827
20661 : * # and the rest of the columns need to be eliminated using rotations.
20662 : *
20663 : * for i in range(p): # <<<<<<<<<<<<<<
20664 : * for j in range(n-p+i-1, k+i-1, -1):
20665 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20666 : */
20667 216 : __pyx_t_4 = __pyx_v_p;
20668 216 : __pyx_t_2 = __pyx_t_4;
20669 216 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20670 166 : __pyx_v_i = __pyx_t_3;
20671 :
20672 : /* "scipy/linalg/_decomp_update.pyx":828
20673 : *
20674 : * for i in range(p):
20675 : * for j in range(n-p+i-1, k+i-1, -1): # <<<<<<<<<<<<<<
20676 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20677 : * if j+1 < n:
20678 : */
20679 166 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
20680 166 : __pyx_t_6 = __pyx_t_5;
20681 1065 : for (__pyx_t_7 = (((__pyx_v_n - __pyx_v_p) + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
20682 899 : __pyx_v_j = __pyx_t_7;
20683 :
20684 : /* "scipy/linalg/_decomp_update.pyx":829
20685 : * for i in range(p):
20686 : * for j in range(n-p+i-1, k+i-1, -1):
20687 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
20688 : * if j+1 < n:
20689 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20690 : */
20691 899 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
20692 :
20693 : /* "scipy/linalg/_decomp_update.pyx":830
20694 : * for j in range(n-p+i-1, k+i-1, -1):
20695 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20696 : * if j+1 < n: # <<<<<<<<<<<<<<
20697 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20698 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20699 : */
20700 899 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
20701 899 : if (__pyx_t_1) {
20702 :
20703 : /* "scipy/linalg/_decomp_update.pyx":831
20704 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20705 : * if j+1 < n:
20706 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
20707 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20708 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
20709 : */
20710 899 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
20711 :
20712 : /* "scipy/linalg/_decomp_update.pyx":830
20713 : * for j in range(n-p+i-1, k+i-1, -1):
20714 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20715 : * if j+1 < n: # <<<<<<<<<<<<<<
20716 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20717 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20718 : */
20719 : }
20720 :
20721 : /* "scipy/linalg/_decomp_update.pyx":833
20722 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20723 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20724 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
20725 : * c, s.conjugate())
20726 : * else:
20727 : */
20728 899 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
20729 : }
20730 : }
20731 :
20732 : /* "scipy/linalg/_decomp_update.pyx":756
20733 : * cdef char* trans = 'N'
20734 : *
20735 : * if m >= n: # <<<<<<<<<<<<<<
20736 : * # if m > n, r looks like this.
20737 : * # x x x x x x x x x x
20738 : */
20739 50 : goto __pyx_L3;
20740 : }
20741 :
20742 : /* "scipy/linalg/_decomp_update.pyx":837
20743 : * else:
20744 : * # this case we can only uses givens rotations.
20745 : * for i in range(p): # <<<<<<<<<<<<<<
20746 : * for j in range(m-2, k+i-1, -1):
20747 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20748 : */
20749 : /*else*/ {
20750 440 : __pyx_t_4 = __pyx_v_p;
20751 440 : __pyx_t_2 = __pyx_t_4;
20752 440 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20753 336 : __pyx_v_i = __pyx_t_3;
20754 :
20755 : /* "scipy/linalg/_decomp_update.pyx":838
20756 : * # this case we can only uses givens rotations.
20757 : * for i in range(p):
20758 : * for j in range(m-2, k+i-1, -1): # <<<<<<<<<<<<<<
20759 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20760 : * if j+1 < n:
20761 : */
20762 336 : __pyx_t_5 = ((__pyx_v_k + __pyx_v_i) - 1);
20763 336 : __pyx_t_6 = __pyx_t_5;
20764 1830 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
20765 1494 : __pyx_v_j = __pyx_t_7;
20766 :
20767 : /* "scipy/linalg/_decomp_update.pyx":839
20768 : * for i in range(p):
20769 : * for j in range(m-2, k+i-1, -1):
20770 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s) # <<<<<<<<<<<<<<
20771 : * if j+1 < n:
20772 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20773 : */
20774 1494 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_k + __pyx_v_i)), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_k + __pyx_v_i)), (&__pyx_v_c), (&__pyx_v_s));
20775 :
20776 : /* "scipy/linalg/_decomp_update.pyx":840
20777 : * for j in range(m-2, k+i-1, -1):
20778 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20779 : * if j+1 < n: # <<<<<<<<<<<<<<
20780 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20781 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20782 : */
20783 1494 : __pyx_t_1 = ((__pyx_v_j + 1) < __pyx_v_n);
20784 1494 : if (__pyx_t_1) {
20785 :
20786 : /* "scipy/linalg/_decomp_update.pyx":841
20787 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20788 : * if j+1 < n:
20789 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1], # <<<<<<<<<<<<<<
20790 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20791 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
20792 : */
20793 1494 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((((__pyx_v_n - __pyx_v_k) - __pyx_v_i) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), ((__pyx_v_k + __pyx_v_i) + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
20794 :
20795 : /* "scipy/linalg/_decomp_update.pyx":840
20796 : * for j in range(m-2, k+i-1, -1):
20797 : * lartg(index2(r, rs, j, k+i), index2(r, rs, j+1, k+i), &c, &s)
20798 : * if j+1 < n: # <<<<<<<<<<<<<<
20799 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20800 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20801 : */
20802 : }
20803 :
20804 : /* "scipy/linalg/_decomp_update.pyx":843
20805 : * rot(n-k-i-1, index2(r, rs, j, k+i+1), rs[1],
20806 : * index2(r, rs, j+1, k+i+1), rs[1], c, s)
20807 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
20808 : * c, s.conjugate())
20809 : * return 0
20810 : */
20811 1494 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
20812 : }
20813 : }
20814 : }
20815 104 : __pyx_L3:;
20816 :
20817 : /* "scipy/linalg/_decomp_update.pyx":845
20818 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
20819 : * c, s.conjugate())
20820 : * return 0 # <<<<<<<<<<<<<<
20821 : *
20822 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF,
20823 : */
20824 154 : __pyx_r = 0;
20825 154 : goto __pyx_L0;
20826 :
20827 : /* "scipy/linalg/_decomp_update.pyx":746
20828 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
20829 : *
20830 : * cdef int qr_block_col_insert(int m, int n, blas_t* q, int* qs, # <<<<<<<<<<<<<<
20831 : * blas_t* r, int* rs, int k, int p) noexcept nogil:
20832 : * cdef int i, j
20833 : */
20834 :
20835 : /* function exit code */
20836 154 : __pyx_L0:;
20837 154 : return __pyx_r;
20838 : }
20839 :
20840 : /* "scipy/linalg/_decomp_update.pyx":847
20841 : * return 0
20842 : *
20843 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
20844 : * blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs, blas_t* s,
20845 : * int* ss) noexcept nogil:
20846 : */
20847 :
20848 178 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, float *__pyx_v_r, int *__pyx_v_rs, float *__pyx_v_u, int *__pyx_v_us, float *__pyx_v_v, int *__pyx_v_vs, float *__pyx_v_s, int *__pyx_v_ss) {
20849 178 : int __pyx_v_j;
20850 178 : float __pyx_v_c;
20851 178 : float __pyx_v_sn;
20852 178 : float __pyx_v_rlast;
20853 178 : float __pyx_v_t;
20854 178 : float __pyx_v_rcond;
20855 178 : int __pyx_t_1;
20856 178 : long __pyx_t_2;
20857 178 : long __pyx_t_3;
20858 :
20859 : /* "scipy/linalg/_decomp_update.pyx":854
20860 : * """
20861 : * cdef int j
20862 : * cdef blas_t c, sn, rlast, t, rcond = 0.0 # <<<<<<<<<<<<<<
20863 : *
20864 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond)
20865 : */
20866 178 : __pyx_v_rcond = 0.0;
20867 :
20868 : /* "scipy/linalg/_decomp_update.pyx":856
20869 : * cdef blas_t c, sn, rlast, t, rcond = 0.0
20870 : *
20871 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond) # <<<<<<<<<<<<<<
20872 : *
20873 : * # reduce s with givens, using u as the n+1 column of q
20874 : */
20875 178 : (void)(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_u, __pyx_v_us, __pyx_v_s, (&__pyx_v_rcond)));
20876 :
20877 : /* "scipy/linalg/_decomp_update.pyx":860
20878 : * # reduce s with givens, using u as the n+1 column of q
20879 : * # do the first one since the rots will be different.
20880 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn) # <<<<<<<<<<<<<<
20881 : * t = index2(r, rs, n-1, n-1)[0]
20882 : * rlast = -t * sn.conjugate()
20883 : */
20884 178 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_n - 1)), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), (&__pyx_v_c), (&__pyx_v_sn));
20885 :
20886 : /* "scipy/linalg/_decomp_update.pyx":861
20887 : * # do the first one since the rots will be different.
20888 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
20889 : * t = index2(r, rs, n-1, n-1)[0] # <<<<<<<<<<<<<<
20890 : * rlast = -t * sn.conjugate()
20891 : * index2(r, rs, n-1, n-1)[0] = t * c
20892 : */
20893 178 : __pyx_v_t = (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]);
20894 :
20895 : /* "scipy/linalg/_decomp_update.pyx":862
20896 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
20897 : * t = index2(r, rs, n-1, n-1)[0]
20898 : * rlast = -t * sn.conjugate() # <<<<<<<<<<<<<<
20899 : * index2(r, rs, n-1, n-1)[0] = t * c
20900 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
20901 : */
20902 178 : __pyx_v_rlast = ((-__pyx_v_t) * (__pyx_v_sn));
20903 :
20904 : /* "scipy/linalg/_decomp_update.pyx":863
20905 : * t = index2(r, rs, n-1, n-1)[0]
20906 : * rlast = -t * sn.conjugate()
20907 : * index2(r, rs, n-1, n-1)[0] = t * c # <<<<<<<<<<<<<<
20908 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
20909 : *
20910 : */
20911 178 : (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]) = (__pyx_v_t * __pyx_v_c);
20912 :
20913 : /* "scipy/linalg/_decomp_update.pyx":864
20914 : * rlast = -t * sn.conjugate()
20915 : * index2(r, rs, n-1, n-1)[0] = t * c
20916 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
20917 : *
20918 : * for j in range(n-2, -1, -1):
20919 : */
20920 178 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, (__pyx_v_sn));
20921 :
20922 : /* "scipy/linalg/_decomp_update.pyx":866
20923 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
20924 : *
20925 : * for j in range(n-2, -1, -1): # <<<<<<<<<<<<<<
20926 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
20927 : * rot(n-j, index2(r, rs, j, j), rs[1],
20928 : */
20929 1229 : for (__pyx_t_1 = (__pyx_v_n - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
20930 1051 : __pyx_v_j = __pyx_t_1;
20931 :
20932 : /* "scipy/linalg/_decomp_update.pyx":867
20933 : *
20934 : * for j in range(n-2, -1, -1):
20935 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn) # <<<<<<<<<<<<<<
20936 : * rot(n-j, index2(r, rs, j, j), rs[1],
20937 : * index2(r, rs, j+1, j), rs[1], c, sn)
20938 : */
20939 1051 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_sn));
20940 :
20941 : /* "scipy/linalg/_decomp_update.pyx":868
20942 : * for j in range(n-2, -1, -1):
20943 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
20944 : * rot(n-j, index2(r, rs, j, j), rs[1], # <<<<<<<<<<<<<<
20945 : * index2(r, rs, j+1, j), rs[1], c, sn)
20946 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
20947 : */
20948 1051 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
20949 :
20950 : /* "scipy/linalg/_decomp_update.pyx":870
20951 : * rot(n-j, index2(r, rs, j, j), rs[1],
20952 : * index2(r, rs, j+1, j), rs[1], c, sn)
20953 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
20954 : *
20955 : * # add v to the first row of r
20956 : */
20957 1051 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
20958 : }
20959 :
20960 : /* "scipy/linalg/_decomp_update.pyx":873
20961 : *
20962 : * # add v to the first row of r
20963 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
20964 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1])
20965 : *
20966 : */
20967 178 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
20968 :
20969 : /* "scipy/linalg/_decomp_update.pyx":874
20970 : * # add v to the first row of r
20971 : * blas_t_conj(n, v, vs)
20972 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
20973 : *
20974 : * # now r is upper hessenberg with the only value in the last row stored in
20975 : */
20976 178 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_s[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
20977 :
20978 : /* "scipy/linalg/_decomp_update.pyx":879
20979 : * # rlast (This is very similar to hessenberg_qr below, but this loop ends
20980 : * # at n-1 instead of n)
20981 : * for j in range(n-1): # <<<<<<<<<<<<<<
20982 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
20983 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
20984 : */
20985 178 : __pyx_t_2 = (__pyx_v_n - 1);
20986 178 : __pyx_t_3 = __pyx_t_2;
20987 1229 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
20988 1051 : __pyx_v_j = __pyx_t_1;
20989 :
20990 : /* "scipy/linalg/_decomp_update.pyx":880
20991 : * # at n-1 instead of n)
20992 : * for j in range(n-1):
20993 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn) # <<<<<<<<<<<<<<
20994 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
20995 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
20996 : */
20997 1051 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
20998 :
20999 : /* "scipy/linalg/_decomp_update.pyx":881
21000 : * for j in range(n-1):
21001 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
21002 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
21003 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21004 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
21005 : */
21006 1051 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
21007 :
21008 : /* "scipy/linalg/_decomp_update.pyx":883
21009 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21010 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21011 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21012 : *
21013 : * # handle the extra value in rlast
21014 : */
21015 1051 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
21016 : }
21017 :
21018 : /* "scipy/linalg/_decomp_update.pyx":886
21019 : *
21020 : * # handle the extra value in rlast
21021 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn) # <<<<<<<<<<<<<<
21022 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21023 : *
21024 : */
21025 178 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1)), (&__pyx_v_rlast), (&__pyx_v_c), (&__pyx_v_sn));
21026 :
21027 : /* "scipy/linalg/_decomp_update.pyx":887
21028 : * # handle the extra value in rlast
21029 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn)
21030 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21031 : *
21032 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs,
21033 : */
21034 178 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, (__pyx_v_sn));
21035 :
21036 : /* "scipy/linalg/_decomp_update.pyx":847
21037 : * return 0
21038 : *
21039 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
21040 : * blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs, blas_t* s,
21041 : * int* ss) noexcept nogil:
21042 : */
21043 :
21044 : /* function exit code */
21045 178 : }
21046 :
21047 178 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, double *__pyx_v_r, int *__pyx_v_rs, double *__pyx_v_u, int *__pyx_v_us, double *__pyx_v_v, int *__pyx_v_vs, double *__pyx_v_s, int *__pyx_v_ss) {
21048 178 : int __pyx_v_j;
21049 178 : double __pyx_v_c;
21050 178 : double __pyx_v_sn;
21051 178 : double __pyx_v_rlast;
21052 178 : double __pyx_v_t;
21053 178 : double __pyx_v_rcond;
21054 178 : int __pyx_t_1;
21055 178 : long __pyx_t_2;
21056 178 : long __pyx_t_3;
21057 :
21058 : /* "scipy/linalg/_decomp_update.pyx":854
21059 : * """
21060 : * cdef int j
21061 : * cdef blas_t c, sn, rlast, t, rcond = 0.0 # <<<<<<<<<<<<<<
21062 : *
21063 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond)
21064 : */
21065 178 : __pyx_v_rcond = 0.0;
21066 :
21067 : /* "scipy/linalg/_decomp_update.pyx":856
21068 : * cdef blas_t c, sn, rlast, t, rcond = 0.0
21069 : *
21070 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond) # <<<<<<<<<<<<<<
21071 : *
21072 : * # reduce s with givens, using u as the n+1 column of q
21073 : */
21074 178 : (void)(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_u, __pyx_v_us, __pyx_v_s, (&__pyx_v_rcond)));
21075 :
21076 : /* "scipy/linalg/_decomp_update.pyx":860
21077 : * # reduce s with givens, using u as the n+1 column of q
21078 : * # do the first one since the rots will be different.
21079 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn) # <<<<<<<<<<<<<<
21080 : * t = index2(r, rs, n-1, n-1)[0]
21081 : * rlast = -t * sn.conjugate()
21082 : */
21083 178 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_n - 1)), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), (&__pyx_v_c), (&__pyx_v_sn));
21084 :
21085 : /* "scipy/linalg/_decomp_update.pyx":861
21086 : * # do the first one since the rots will be different.
21087 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
21088 : * t = index2(r, rs, n-1, n-1)[0] # <<<<<<<<<<<<<<
21089 : * rlast = -t * sn.conjugate()
21090 : * index2(r, rs, n-1, n-1)[0] = t * c
21091 : */
21092 178 : __pyx_v_t = (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]);
21093 :
21094 : /* "scipy/linalg/_decomp_update.pyx":862
21095 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
21096 : * t = index2(r, rs, n-1, n-1)[0]
21097 : * rlast = -t * sn.conjugate() # <<<<<<<<<<<<<<
21098 : * index2(r, rs, n-1, n-1)[0] = t * c
21099 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21100 : */
21101 178 : __pyx_v_rlast = ((-__pyx_v_t) * (__pyx_v_sn));
21102 :
21103 : /* "scipy/linalg/_decomp_update.pyx":863
21104 : * t = index2(r, rs, n-1, n-1)[0]
21105 : * rlast = -t * sn.conjugate()
21106 : * index2(r, rs, n-1, n-1)[0] = t * c # <<<<<<<<<<<<<<
21107 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21108 : *
21109 : */
21110 178 : (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]) = (__pyx_v_t * __pyx_v_c);
21111 :
21112 : /* "scipy/linalg/_decomp_update.pyx":864
21113 : * rlast = -t * sn.conjugate()
21114 : * index2(r, rs, n-1, n-1)[0] = t * c
21115 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21116 : *
21117 : * for j in range(n-2, -1, -1):
21118 : */
21119 178 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, (__pyx_v_sn));
21120 :
21121 : /* "scipy/linalg/_decomp_update.pyx":866
21122 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21123 : *
21124 : * for j in range(n-2, -1, -1): # <<<<<<<<<<<<<<
21125 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
21126 : * rot(n-j, index2(r, rs, j, j), rs[1],
21127 : */
21128 1229 : for (__pyx_t_1 = (__pyx_v_n - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
21129 1051 : __pyx_v_j = __pyx_t_1;
21130 :
21131 : /* "scipy/linalg/_decomp_update.pyx":867
21132 : *
21133 : * for j in range(n-2, -1, -1):
21134 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn) # <<<<<<<<<<<<<<
21135 : * rot(n-j, index2(r, rs, j, j), rs[1],
21136 : * index2(r, rs, j+1, j), rs[1], c, sn)
21137 : */
21138 1051 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_sn));
21139 :
21140 : /* "scipy/linalg/_decomp_update.pyx":868
21141 : * for j in range(n-2, -1, -1):
21142 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
21143 : * rot(n-j, index2(r, rs, j, j), rs[1], # <<<<<<<<<<<<<<
21144 : * index2(r, rs, j+1, j), rs[1], c, sn)
21145 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
21146 : */
21147 1051 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
21148 :
21149 : /* "scipy/linalg/_decomp_update.pyx":870
21150 : * rot(n-j, index2(r, rs, j, j), rs[1],
21151 : * index2(r, rs, j+1, j), rs[1], c, sn)
21152 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21153 : *
21154 : * # add v to the first row of r
21155 : */
21156 1051 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
21157 : }
21158 :
21159 : /* "scipy/linalg/_decomp_update.pyx":873
21160 : *
21161 : * # add v to the first row of r
21162 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
21163 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1])
21164 : *
21165 : */
21166 178 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
21167 :
21168 : /* "scipy/linalg/_decomp_update.pyx":874
21169 : * # add v to the first row of r
21170 : * blas_t_conj(n, v, vs)
21171 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
21172 : *
21173 : * # now r is upper hessenberg with the only value in the last row stored in
21174 : */
21175 178 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_s[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
21176 :
21177 : /* "scipy/linalg/_decomp_update.pyx":879
21178 : * # rlast (This is very similar to hessenberg_qr below, but this loop ends
21179 : * # at n-1 instead of n)
21180 : * for j in range(n-1): # <<<<<<<<<<<<<<
21181 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
21182 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21183 : */
21184 178 : __pyx_t_2 = (__pyx_v_n - 1);
21185 178 : __pyx_t_3 = __pyx_t_2;
21186 1229 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
21187 1051 : __pyx_v_j = __pyx_t_1;
21188 :
21189 : /* "scipy/linalg/_decomp_update.pyx":880
21190 : * # at n-1 instead of n)
21191 : * for j in range(n-1):
21192 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn) # <<<<<<<<<<<<<<
21193 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21194 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21195 : */
21196 1051 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
21197 :
21198 : /* "scipy/linalg/_decomp_update.pyx":881
21199 : * for j in range(n-1):
21200 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
21201 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
21202 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21203 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
21204 : */
21205 1051 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
21206 :
21207 : /* "scipy/linalg/_decomp_update.pyx":883
21208 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21209 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21210 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21211 : *
21212 : * # handle the extra value in rlast
21213 : */
21214 1051 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_sn));
21215 : }
21216 :
21217 : /* "scipy/linalg/_decomp_update.pyx":886
21218 : *
21219 : * # handle the extra value in rlast
21220 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn) # <<<<<<<<<<<<<<
21221 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21222 : *
21223 : */
21224 178 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1)), (&__pyx_v_rlast), (&__pyx_v_c), (&__pyx_v_sn));
21225 :
21226 : /* "scipy/linalg/_decomp_update.pyx":887
21227 : * # handle the extra value in rlast
21228 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn)
21229 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21230 : *
21231 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs,
21232 : */
21233 178 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, (__pyx_v_sn));
21234 :
21235 : /* "scipy/linalg/_decomp_update.pyx":847
21236 : * return 0
21237 : *
21238 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
21239 : * blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs, blas_t* s,
21240 : * int* ss) noexcept nogil:
21241 : */
21242 :
21243 : /* function exit code */
21244 178 : }
21245 :
21246 178 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_float_complex *__pyx_v_v, int *__pyx_v_vs, __pyx_t_float_complex *__pyx_v_s, int *__pyx_v_ss) {
21247 178 : int __pyx_v_j;
21248 178 : __pyx_t_float_complex __pyx_v_c;
21249 178 : __pyx_t_float_complex __pyx_v_sn;
21250 178 : __pyx_t_float_complex __pyx_v_rlast;
21251 178 : __pyx_t_float_complex __pyx_v_t;
21252 178 : __pyx_t_float_complex __pyx_v_rcond;
21253 178 : int __pyx_t_1;
21254 178 : long __pyx_t_2;
21255 178 : long __pyx_t_3;
21256 :
21257 : /* "scipy/linalg/_decomp_update.pyx":854
21258 : * """
21259 : * cdef int j
21260 : * cdef blas_t c, sn, rlast, t, rcond = 0.0 # <<<<<<<<<<<<<<
21261 : *
21262 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond)
21263 : */
21264 178 : __pyx_v_rcond = __pyx_t_float_complex_from_parts(0.0, 0);
21265 :
21266 : /* "scipy/linalg/_decomp_update.pyx":856
21267 : * cdef blas_t c, sn, rlast, t, rcond = 0.0
21268 : *
21269 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond) # <<<<<<<<<<<<<<
21270 : *
21271 : * # reduce s with givens, using u as the n+1 column of q
21272 : */
21273 178 : (void)(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_u, __pyx_v_us, __pyx_v_s, (&__pyx_v_rcond)));
21274 :
21275 : /* "scipy/linalg/_decomp_update.pyx":860
21276 : * # reduce s with givens, using u as the n+1 column of q
21277 : * # do the first one since the rots will be different.
21278 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn) # <<<<<<<<<<<<<<
21279 : * t = index2(r, rs, n-1, n-1)[0]
21280 : * rlast = -t * sn.conjugate()
21281 : */
21282 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_n - 1)), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), (&__pyx_v_c), (&__pyx_v_sn));
21283 :
21284 : /* "scipy/linalg/_decomp_update.pyx":861
21285 : * # do the first one since the rots will be different.
21286 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
21287 : * t = index2(r, rs, n-1, n-1)[0] # <<<<<<<<<<<<<<
21288 : * rlast = -t * sn.conjugate()
21289 : * index2(r, rs, n-1, n-1)[0] = t * c
21290 : */
21291 178 : __pyx_v_t = (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]);
21292 :
21293 : /* "scipy/linalg/_decomp_update.pyx":862
21294 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
21295 : * t = index2(r, rs, n-1, n-1)[0]
21296 : * rlast = -t * sn.conjugate() # <<<<<<<<<<<<<<
21297 : * index2(r, rs, n-1, n-1)[0] = t * c
21298 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21299 : */
21300 178 : __pyx_v_rlast = __Pyx_c_prod_float(__Pyx_c_neg_float(__pyx_v_t), __Pyx_c_conj_float(__pyx_v_sn));
21301 :
21302 : /* "scipy/linalg/_decomp_update.pyx":863
21303 : * t = index2(r, rs, n-1, n-1)[0]
21304 : * rlast = -t * sn.conjugate()
21305 : * index2(r, rs, n-1, n-1)[0] = t * c # <<<<<<<<<<<<<<
21306 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21307 : *
21308 : */
21309 178 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]) = __Pyx_c_prod_float(__pyx_v_t, __pyx_v_c);
21310 :
21311 : /* "scipy/linalg/_decomp_update.pyx":864
21312 : * rlast = -t * sn.conjugate()
21313 : * index2(r, rs, n-1, n-1)[0] = t * c
21314 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21315 : *
21316 : * for j in range(n-2, -1, -1):
21317 : */
21318 356 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_sn));
21319 :
21320 : /* "scipy/linalg/_decomp_update.pyx":866
21321 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21322 : *
21323 : * for j in range(n-2, -1, -1): # <<<<<<<<<<<<<<
21324 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
21325 : * rot(n-j, index2(r, rs, j, j), rs[1],
21326 : */
21327 1229 : for (__pyx_t_1 = (__pyx_v_n - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
21328 1051 : __pyx_v_j = __pyx_t_1;
21329 :
21330 : /* "scipy/linalg/_decomp_update.pyx":867
21331 : *
21332 : * for j in range(n-2, -1, -1):
21333 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn) # <<<<<<<<<<<<<<
21334 : * rot(n-j, index2(r, rs, j, j), rs[1],
21335 : * index2(r, rs, j+1, j), rs[1], c, sn)
21336 : */
21337 1051 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_sn));
21338 :
21339 : /* "scipy/linalg/_decomp_update.pyx":868
21340 : * for j in range(n-2, -1, -1):
21341 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
21342 : * rot(n-j, index2(r, rs, j, j), rs[1], # <<<<<<<<<<<<<<
21343 : * index2(r, rs, j+1, j), rs[1], c, sn)
21344 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
21345 : */
21346 1051 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
21347 :
21348 : /* "scipy/linalg/_decomp_update.pyx":870
21349 : * rot(n-j, index2(r, rs, j, j), rs[1],
21350 : * index2(r, rs, j+1, j), rs[1], c, sn)
21351 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21352 : *
21353 : * # add v to the first row of r
21354 : */
21355 1051 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_sn));
21356 : }
21357 :
21358 : /* "scipy/linalg/_decomp_update.pyx":873
21359 : *
21360 : * # add v to the first row of r
21361 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
21362 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1])
21363 : *
21364 : */
21365 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
21366 :
21367 : /* "scipy/linalg/_decomp_update.pyx":874
21368 : * # add v to the first row of r
21369 : * blas_t_conj(n, v, vs)
21370 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
21371 : *
21372 : * # now r is upper hessenberg with the only value in the last row stored in
21373 : */
21374 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_s[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
21375 :
21376 : /* "scipy/linalg/_decomp_update.pyx":879
21377 : * # rlast (This is very similar to hessenberg_qr below, but this loop ends
21378 : * # at n-1 instead of n)
21379 : * for j in range(n-1): # <<<<<<<<<<<<<<
21380 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
21381 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21382 : */
21383 178 : __pyx_t_2 = (__pyx_v_n - 1);
21384 178 : __pyx_t_3 = __pyx_t_2;
21385 1229 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
21386 1051 : __pyx_v_j = __pyx_t_1;
21387 :
21388 : /* "scipy/linalg/_decomp_update.pyx":880
21389 : * # at n-1 instead of n)
21390 : * for j in range(n-1):
21391 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn) # <<<<<<<<<<<<<<
21392 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21393 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21394 : */
21395 1051 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
21396 :
21397 : /* "scipy/linalg/_decomp_update.pyx":881
21398 : * for j in range(n-1):
21399 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
21400 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
21401 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21402 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
21403 : */
21404 1051 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
21405 :
21406 : /* "scipy/linalg/_decomp_update.pyx":883
21407 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21408 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21409 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21410 : *
21411 : * # handle the extra value in rlast
21412 : */
21413 1051 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_sn));
21414 : }
21415 :
21416 : /* "scipy/linalg/_decomp_update.pyx":886
21417 : *
21418 : * # handle the extra value in rlast
21419 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn) # <<<<<<<<<<<<<<
21420 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21421 : *
21422 : */
21423 178 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1)), (&__pyx_v_rlast), (&__pyx_v_c), (&__pyx_v_sn));
21424 :
21425 : /* "scipy/linalg/_decomp_update.pyx":887
21426 : * # handle the extra value in rlast
21427 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn)
21428 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21429 : *
21430 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs,
21431 : */
21432 356 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_sn));
21433 :
21434 : /* "scipy/linalg/_decomp_update.pyx":847
21435 : * return 0
21436 : *
21437 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
21438 : * blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs, blas_t* s,
21439 : * int* ss) noexcept nogil:
21440 : */
21441 :
21442 : /* function exit code */
21443 178 : }
21444 :
21445 178 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_double_complex *__pyx_v_v, int *__pyx_v_vs, __pyx_t_double_complex *__pyx_v_s, int *__pyx_v_ss) {
21446 178 : int __pyx_v_j;
21447 178 : __pyx_t_double_complex __pyx_v_c;
21448 178 : __pyx_t_double_complex __pyx_v_sn;
21449 178 : __pyx_t_double_complex __pyx_v_rlast;
21450 178 : __pyx_t_double_complex __pyx_v_t;
21451 178 : __pyx_t_double_complex __pyx_v_rcond;
21452 178 : int __pyx_t_1;
21453 178 : long __pyx_t_2;
21454 178 : long __pyx_t_3;
21455 :
21456 : /* "scipy/linalg/_decomp_update.pyx":854
21457 : * """
21458 : * cdef int j
21459 : * cdef blas_t c, sn, rlast, t, rcond = 0.0 # <<<<<<<<<<<<<<
21460 : *
21461 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond)
21462 : */
21463 178 : __pyx_v_rcond = __pyx_t_double_complex_from_parts(0.0, 0);
21464 :
21465 : /* "scipy/linalg/_decomp_update.pyx":856
21466 : * cdef blas_t c, sn, rlast, t, rcond = 0.0
21467 : *
21468 : * reorth(m, n, q, qs, qisF, u, us, s, &rcond) # <<<<<<<<<<<<<<
21469 : *
21470 : * # reduce s with givens, using u as the n+1 column of q
21471 : */
21472 178 : (void)(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorth(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_u, __pyx_v_us, __pyx_v_s, (&__pyx_v_rcond)));
21473 :
21474 : /* "scipy/linalg/_decomp_update.pyx":860
21475 : * # reduce s with givens, using u as the n+1 column of q
21476 : * # do the first one since the rots will be different.
21477 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn) # <<<<<<<<<<<<<<
21478 : * t = index2(r, rs, n-1, n-1)[0]
21479 : * rlast = -t * sn.conjugate()
21480 : */
21481 178 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_n - 1)), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_n), (&__pyx_v_c), (&__pyx_v_sn));
21482 :
21483 : /* "scipy/linalg/_decomp_update.pyx":861
21484 : * # do the first one since the rots will be different.
21485 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
21486 : * t = index2(r, rs, n-1, n-1)[0] # <<<<<<<<<<<<<<
21487 : * rlast = -t * sn.conjugate()
21488 : * index2(r, rs, n-1, n-1)[0] = t * c
21489 : */
21490 178 : __pyx_v_t = (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]);
21491 :
21492 : /* "scipy/linalg/_decomp_update.pyx":862
21493 : * lartg(index1(s, ss, n-1), index1(s, ss, n), &c, &sn)
21494 : * t = index2(r, rs, n-1, n-1)[0]
21495 : * rlast = -t * sn.conjugate() # <<<<<<<<<<<<<<
21496 : * index2(r, rs, n-1, n-1)[0] = t * c
21497 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21498 : */
21499 178 : __pyx_v_rlast = __Pyx_c_prod_double(__Pyx_c_neg_double(__pyx_v_t), __Pyx_c_conj_double(__pyx_v_sn));
21500 :
21501 : /* "scipy/linalg/_decomp_update.pyx":863
21502 : * t = index2(r, rs, n-1, n-1)[0]
21503 : * rlast = -t * sn.conjugate()
21504 : * index2(r, rs, n-1, n-1)[0] = t * c # <<<<<<<<<<<<<<
21505 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21506 : *
21507 : */
21508 178 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1))[0]) = __Pyx_c_prod_double(__pyx_v_t, __pyx_v_c);
21509 :
21510 : /* "scipy/linalg/_decomp_update.pyx":864
21511 : * rlast = -t * sn.conjugate()
21512 : * index2(r, rs, n-1, n-1)[0] = t * c
21513 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21514 : *
21515 : * for j in range(n-2, -1, -1):
21516 : */
21517 356 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_sn));
21518 :
21519 : /* "scipy/linalg/_decomp_update.pyx":866
21520 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21521 : *
21522 : * for j in range(n-2, -1, -1): # <<<<<<<<<<<<<<
21523 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
21524 : * rot(n-j, index2(r, rs, j, j), rs[1],
21525 : */
21526 1229 : for (__pyx_t_1 = (__pyx_v_n - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
21527 1051 : __pyx_v_j = __pyx_t_1;
21528 :
21529 : /* "scipy/linalg/_decomp_update.pyx":867
21530 : *
21531 : * for j in range(n-2, -1, -1):
21532 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn) # <<<<<<<<<<<<<<
21533 : * rot(n-j, index2(r, rs, j, j), rs[1],
21534 : * index2(r, rs, j+1, j), rs[1], c, sn)
21535 : */
21536 1051 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_s, __pyx_v_ss, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_sn));
21537 :
21538 : /* "scipy/linalg/_decomp_update.pyx":868
21539 : * for j in range(n-2, -1, -1):
21540 : * lartg(index1(s, ss, j), index1(s, ss, j+1), &c, &sn)
21541 : * rot(n-j, index2(r, rs, j, j), rs[1], # <<<<<<<<<<<<<<
21542 : * index2(r, rs, j+1, j), rs[1], c, sn)
21543 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
21544 : */
21545 1051 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
21546 :
21547 : /* "scipy/linalg/_decomp_update.pyx":870
21548 : * rot(n-j, index2(r, rs, j, j), rs[1],
21549 : * index2(r, rs, j+1, j), rs[1], c, sn)
21550 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21551 : *
21552 : * # add v to the first row of r
21553 : */
21554 1051 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_sn));
21555 : }
21556 :
21557 : /* "scipy/linalg/_decomp_update.pyx":873
21558 : *
21559 : * # add v to the first row of r
21560 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
21561 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1])
21562 : *
21563 : */
21564 178 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
21565 :
21566 : /* "scipy/linalg/_decomp_update.pyx":874
21567 : * # add v to the first row of r
21568 : * blas_t_conj(n, v, vs)
21569 : * axpy(n, s[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
21570 : *
21571 : * # now r is upper hessenberg with the only value in the last row stored in
21572 : */
21573 178 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_s[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
21574 :
21575 : /* "scipy/linalg/_decomp_update.pyx":879
21576 : * # rlast (This is very similar to hessenberg_qr below, but this loop ends
21577 : * # at n-1 instead of n)
21578 : * for j in range(n-1): # <<<<<<<<<<<<<<
21579 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
21580 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21581 : */
21582 178 : __pyx_t_2 = (__pyx_v_n - 1);
21583 178 : __pyx_t_3 = __pyx_t_2;
21584 1229 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
21585 1051 : __pyx_v_j = __pyx_t_1;
21586 :
21587 : /* "scipy/linalg/_decomp_update.pyx":880
21588 : * # at n-1 instead of n)
21589 : * for j in range(n-1):
21590 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn) # <<<<<<<<<<<<<<
21591 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21592 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21593 : */
21594 1051 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_sn));
21595 :
21596 : /* "scipy/linalg/_decomp_update.pyx":881
21597 : * for j in range(n-1):
21598 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &sn)
21599 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
21600 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21601 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate())
21602 : */
21603 1051 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_sn);
21604 :
21605 : /* "scipy/linalg/_decomp_update.pyx":883
21606 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
21607 : * index2(r, rs, j+1, j+1), rs[1], c, sn)
21608 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21609 : *
21610 : * # handle the extra value in rlast
21611 : */
21612 1051 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_sn));
21613 : }
21614 :
21615 : /* "scipy/linalg/_decomp_update.pyx":886
21616 : *
21617 : * # handle the extra value in rlast
21618 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn) # <<<<<<<<<<<<<<
21619 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21620 : *
21621 : */
21622 178 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_n - 1), (__pyx_v_n - 1)), (&__pyx_v_rlast), (&__pyx_v_c), (&__pyx_v_sn));
21623 :
21624 : /* "scipy/linalg/_decomp_update.pyx":887
21625 : * # handle the extra value in rlast
21626 : * lartg(index2(r, rs, n-1, n-1), &rlast, &c, &sn)
21627 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate()) # <<<<<<<<<<<<<<
21628 : *
21629 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs,
21630 : */
21631 356 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_n - 1)), (__pyx_v_qs[0]), __pyx_v_u, (__pyx_v_us[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_sn));
21632 :
21633 : /* "scipy/linalg/_decomp_update.pyx":847
21634 : * return 0
21635 : *
21636 : * cdef void thin_qr_rank_1_update(int m, int n, blas_t* q, int* qs, bint qisF, # <<<<<<<<<<<<<<
21637 : * blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs, blas_t* s,
21638 : * int* ss) noexcept nogil:
21639 : */
21640 :
21641 : /* function exit code */
21642 178 : }
21643 :
21644 : /* "scipy/linalg/_decomp_update.pyx":889
21645 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21646 : *
21647 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, # <<<<<<<<<<<<<<
21648 : * bint qisF, blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs,
21649 : * blas_t* s, int* ss) noexcept nogil:
21650 : */
21651 :
21652 43 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, float *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, float *__pyx_v_r, int *__pyx_v_rs, float *__pyx_v_u, int *__pyx_v_us, float *__pyx_v_v, int *__pyx_v_vs, float *__pyx_v_s, int *__pyx_v_ss) {
21653 43 : int __pyx_v_j;
21654 43 : int __pyx_t_1;
21655 43 : int __pyx_t_2;
21656 43 : int __pyx_t_3;
21657 :
21658 : /* "scipy/linalg/_decomp_update.pyx":897
21659 : * cdef int j
21660 : *
21661 : * for j in range(p): # <<<<<<<<<<<<<<
21662 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us,
21663 : * col(v, vs, j), vs, s, ss)
21664 : */
21665 43 : __pyx_t_1 = __pyx_v_p;
21666 43 : __pyx_t_2 = __pyx_t_1;
21667 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21668 130 : __pyx_v_j = __pyx_t_3;
21669 :
21670 : /* "scipy/linalg/_decomp_update.pyx":898
21671 : *
21672 : * for j in range(p):
21673 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us, # <<<<<<<<<<<<<<
21674 : * col(v, vs, j), vs, s, ss)
21675 : *
21676 : */
21677 130 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_r, __pyx_v_rs, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_v, __pyx_v_vs, __pyx_v_j), __pyx_v_vs, __pyx_v_s, __pyx_v_ss);
21678 : }
21679 :
21680 : /* "scipy/linalg/_decomp_update.pyx":889
21681 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21682 : *
21683 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, # <<<<<<<<<<<<<<
21684 : * bint qisF, blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs,
21685 : * blas_t* s, int* ss) noexcept nogil:
21686 : */
21687 :
21688 : /* function exit code */
21689 43 : }
21690 :
21691 43 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, double *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, double *__pyx_v_r, int *__pyx_v_rs, double *__pyx_v_u, int *__pyx_v_us, double *__pyx_v_v, int *__pyx_v_vs, double *__pyx_v_s, int *__pyx_v_ss) {
21692 43 : int __pyx_v_j;
21693 43 : int __pyx_t_1;
21694 43 : int __pyx_t_2;
21695 43 : int __pyx_t_3;
21696 :
21697 : /* "scipy/linalg/_decomp_update.pyx":897
21698 : * cdef int j
21699 : *
21700 : * for j in range(p): # <<<<<<<<<<<<<<
21701 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us,
21702 : * col(v, vs, j), vs, s, ss)
21703 : */
21704 43 : __pyx_t_1 = __pyx_v_p;
21705 43 : __pyx_t_2 = __pyx_t_1;
21706 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21707 130 : __pyx_v_j = __pyx_t_3;
21708 :
21709 : /* "scipy/linalg/_decomp_update.pyx":898
21710 : *
21711 : * for j in range(p):
21712 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us, # <<<<<<<<<<<<<<
21713 : * col(v, vs, j), vs, s, ss)
21714 : *
21715 : */
21716 130 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_r, __pyx_v_rs, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_v, __pyx_v_vs, __pyx_v_j), __pyx_v_vs, __pyx_v_s, __pyx_v_ss);
21717 : }
21718 :
21719 : /* "scipy/linalg/_decomp_update.pyx":889
21720 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21721 : *
21722 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, # <<<<<<<<<<<<<<
21723 : * bint qisF, blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs,
21724 : * blas_t* s, int* ss) noexcept nogil:
21725 : */
21726 :
21727 : /* function exit code */
21728 43 : }
21729 :
21730 43 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_float_complex *__pyx_v_v, int *__pyx_v_vs, __pyx_t_float_complex *__pyx_v_s, int *__pyx_v_ss) {
21731 43 : int __pyx_v_j;
21732 43 : int __pyx_t_1;
21733 43 : int __pyx_t_2;
21734 43 : int __pyx_t_3;
21735 :
21736 : /* "scipy/linalg/_decomp_update.pyx":897
21737 : * cdef int j
21738 : *
21739 : * for j in range(p): # <<<<<<<<<<<<<<
21740 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us,
21741 : * col(v, vs, j), vs, s, ss)
21742 : */
21743 43 : __pyx_t_1 = __pyx_v_p;
21744 43 : __pyx_t_2 = __pyx_t_1;
21745 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21746 130 : __pyx_v_j = __pyx_t_3;
21747 :
21748 : /* "scipy/linalg/_decomp_update.pyx":898
21749 : *
21750 : * for j in range(p):
21751 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us, # <<<<<<<<<<<<<<
21752 : * col(v, vs, j), vs, s, ss)
21753 : *
21754 : */
21755 130 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_r, __pyx_v_rs, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_v, __pyx_v_vs, __pyx_v_j), __pyx_v_vs, __pyx_v_s, __pyx_v_ss);
21756 : }
21757 :
21758 : /* "scipy/linalg/_decomp_update.pyx":889
21759 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21760 : *
21761 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, # <<<<<<<<<<<<<<
21762 : * bint qisF, blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs,
21763 : * blas_t* s, int* ss) noexcept nogil:
21764 : */
21765 :
21766 : /* function exit code */
21767 43 : }
21768 :
21769 43 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_double_complex *__pyx_v_v, int *__pyx_v_vs, __pyx_t_double_complex *__pyx_v_s, int *__pyx_v_ss) {
21770 43 : int __pyx_v_j;
21771 43 : int __pyx_t_1;
21772 43 : int __pyx_t_2;
21773 43 : int __pyx_t_3;
21774 :
21775 : /* "scipy/linalg/_decomp_update.pyx":897
21776 : * cdef int j
21777 : *
21778 : * for j in range(p): # <<<<<<<<<<<<<<
21779 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us,
21780 : * col(v, vs, j), vs, s, ss)
21781 : */
21782 43 : __pyx_t_1 = __pyx_v_p;
21783 43 : __pyx_t_2 = __pyx_t_1;
21784 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
21785 130 : __pyx_v_j = __pyx_t_3;
21786 :
21787 : /* "scipy/linalg/_decomp_update.pyx":898
21788 : *
21789 : * for j in range(p):
21790 : * thin_qr_rank_1_update(m, n, q, qs, qisF, r, rs, col(u, us, j), us, # <<<<<<<<<<<<<<
21791 : * col(v, vs, j), vs, s, ss)
21792 : *
21793 : */
21794 130 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_qisF, __pyx_v_r, __pyx_v_rs, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_v_us, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_v, __pyx_v_vs, __pyx_v_j), __pyx_v_vs, __pyx_v_s, __pyx_v_ss);
21795 : }
21796 :
21797 : /* "scipy/linalg/_decomp_update.pyx":889
21798 : * rot(m, col(q, qs, n-1), qs[0], u, us[0], c, sn.conjugate())
21799 : *
21800 : * cdef void thin_qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, # <<<<<<<<<<<<<<
21801 : * bint qisF, blas_t* r, int* rs, blas_t* u, int* us, blas_t* v, int* vs,
21802 : * blas_t* s, int* ss) noexcept nogil:
21803 : */
21804 :
21805 : /* function exit code */
21806 43 : }
21807 :
21808 : /* "scipy/linalg/_decomp_update.pyx":901
21809 : * col(v, vs, j), vs, s, ss)
21810 : *
21811 : * cdef void qr_rank_1_update(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
21812 : * blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
21813 : * """ here we will assume that the u = Q.T.dot(u) and not the bare u.
21814 : */
21815 :
21816 211 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, float *__pyx_v_u, int *__pyx_v_us, float *__pyx_v_v, int *__pyx_v_vs) {
21817 211 : int __pyx_v_j;
21818 211 : float __pyx_v_c;
21819 211 : float __pyx_v_s;
21820 211 : int __pyx_t_1;
21821 211 : int __pyx_t_2;
21822 :
21823 : /* "scipy/linalg/_decomp_update.pyx":917
21824 : * # triangular.
21825 : *
21826 : * for j in range(m-2, -1, -1): # <<<<<<<<<<<<<<
21827 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s)
21828 : *
21829 : */
21830 1774 : for (__pyx_t_1 = (__pyx_v_m - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
21831 1563 : __pyx_v_j = __pyx_t_1;
21832 :
21833 : /* "scipy/linalg/_decomp_update.pyx":918
21834 : *
21835 : * for j in range(m-2, -1, -1):
21836 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s) # <<<<<<<<<<<<<<
21837 : *
21838 : * # update jth and (j+1)th rows of r.
21839 : */
21840 1563 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
21841 :
21842 : /* "scipy/linalg/_decomp_update.pyx":921
21843 : *
21844 : * # update jth and (j+1)th rows of r.
21845 : * if n-j > 0: # <<<<<<<<<<<<<<
21846 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
21847 : *
21848 : */
21849 1563 : __pyx_t_2 = ((__pyx_v_n - __pyx_v_j) > 0);
21850 1563 : if (__pyx_t_2) {
21851 :
21852 : /* "scipy/linalg/_decomp_update.pyx":922
21853 : * # update jth and (j+1)th rows of r.
21854 : * if n-j > 0:
21855 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s) # <<<<<<<<<<<<<<
21856 : *
21857 : * # update jth and (j+1)th cols of q.
21858 : */
21859 1383 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
21860 :
21861 : /* "scipy/linalg/_decomp_update.pyx":921
21862 : *
21863 : * # update jth and (j+1)th rows of r.
21864 : * if n-j > 0: # <<<<<<<<<<<<<<
21865 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
21866 : *
21867 : */
21868 : }
21869 :
21870 : /* "scipy/linalg/_decomp_update.pyx":925
21871 : *
21872 : * # update jth and (j+1)th cols of q.
21873 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
21874 : *
21875 : * # add v to the first row
21876 : */
21877 1563 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
21878 : }
21879 :
21880 : /* "scipy/linalg/_decomp_update.pyx":928
21881 : *
21882 : * # add v to the first row
21883 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
21884 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1])
21885 : *
21886 : */
21887 211 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
21888 :
21889 : /* "scipy/linalg/_decomp_update.pyx":929
21890 : * # add v to the first row
21891 : * blas_t_conj(n, v, vs)
21892 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
21893 : *
21894 : * # return to q, r form
21895 : */
21896 211 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_u[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
21897 :
21898 : /* "scipy/linalg/_decomp_update.pyx":932
21899 : *
21900 : * # return to q, r form
21901 : * hessenberg_qr(m, n, q, qs, r, rs, 0) # <<<<<<<<<<<<<<
21902 : * # no return, return q, r from python driver.
21903 : *
21904 : */
21905 211 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0);
21906 :
21907 : /* "scipy/linalg/_decomp_update.pyx":901
21908 : * col(v, vs, j), vs, s, ss)
21909 : *
21910 : * cdef void qr_rank_1_update(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
21911 : * blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
21912 : * """ here we will assume that the u = Q.T.dot(u) and not the bare u.
21913 : */
21914 :
21915 : /* function exit code */
21916 211 : }
21917 :
21918 211 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, double *__pyx_v_u, int *__pyx_v_us, double *__pyx_v_v, int *__pyx_v_vs) {
21919 211 : int __pyx_v_j;
21920 211 : double __pyx_v_c;
21921 211 : double __pyx_v_s;
21922 211 : int __pyx_t_1;
21923 211 : int __pyx_t_2;
21924 :
21925 : /* "scipy/linalg/_decomp_update.pyx":917
21926 : * # triangular.
21927 : *
21928 : * for j in range(m-2, -1, -1): # <<<<<<<<<<<<<<
21929 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s)
21930 : *
21931 : */
21932 1774 : for (__pyx_t_1 = (__pyx_v_m - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
21933 1563 : __pyx_v_j = __pyx_t_1;
21934 :
21935 : /* "scipy/linalg/_decomp_update.pyx":918
21936 : *
21937 : * for j in range(m-2, -1, -1):
21938 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s) # <<<<<<<<<<<<<<
21939 : *
21940 : * # update jth and (j+1)th rows of r.
21941 : */
21942 1563 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
21943 :
21944 : /* "scipy/linalg/_decomp_update.pyx":921
21945 : *
21946 : * # update jth and (j+1)th rows of r.
21947 : * if n-j > 0: # <<<<<<<<<<<<<<
21948 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
21949 : *
21950 : */
21951 1563 : __pyx_t_2 = ((__pyx_v_n - __pyx_v_j) > 0);
21952 1563 : if (__pyx_t_2) {
21953 :
21954 : /* "scipy/linalg/_decomp_update.pyx":922
21955 : * # update jth and (j+1)th rows of r.
21956 : * if n-j > 0:
21957 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s) # <<<<<<<<<<<<<<
21958 : *
21959 : * # update jth and (j+1)th cols of q.
21960 : */
21961 1383 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
21962 :
21963 : /* "scipy/linalg/_decomp_update.pyx":921
21964 : *
21965 : * # update jth and (j+1)th rows of r.
21966 : * if n-j > 0: # <<<<<<<<<<<<<<
21967 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
21968 : *
21969 : */
21970 : }
21971 :
21972 : /* "scipy/linalg/_decomp_update.pyx":925
21973 : *
21974 : * # update jth and (j+1)th cols of q.
21975 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
21976 : *
21977 : * # add v to the first row
21978 : */
21979 1563 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
21980 : }
21981 :
21982 : /* "scipy/linalg/_decomp_update.pyx":928
21983 : *
21984 : * # add v to the first row
21985 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
21986 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1])
21987 : *
21988 : */
21989 211 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
21990 :
21991 : /* "scipy/linalg/_decomp_update.pyx":929
21992 : * # add v to the first row
21993 : * blas_t_conj(n, v, vs)
21994 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
21995 : *
21996 : * # return to q, r form
21997 : */
21998 211 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_u[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
21999 :
22000 : /* "scipy/linalg/_decomp_update.pyx":932
22001 : *
22002 : * # return to q, r form
22003 : * hessenberg_qr(m, n, q, qs, r, rs, 0) # <<<<<<<<<<<<<<
22004 : * # no return, return q, r from python driver.
22005 : *
22006 : */
22007 211 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0);
22008 :
22009 : /* "scipy/linalg/_decomp_update.pyx":901
22010 : * col(v, vs, j), vs, s, ss)
22011 : *
22012 : * cdef void qr_rank_1_update(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
22013 : * blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
22014 : * """ here we will assume that the u = Q.T.dot(u) and not the bare u.
22015 : */
22016 :
22017 : /* function exit code */
22018 211 : }
22019 :
22020 211 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_float_complex *__pyx_v_v, int *__pyx_v_vs) {
22021 211 : int __pyx_v_j;
22022 211 : __pyx_t_float_complex __pyx_v_c;
22023 211 : __pyx_t_float_complex __pyx_v_s;
22024 211 : int __pyx_t_1;
22025 211 : int __pyx_t_2;
22026 :
22027 : /* "scipy/linalg/_decomp_update.pyx":917
22028 : * # triangular.
22029 : *
22030 : * for j in range(m-2, -1, -1): # <<<<<<<<<<<<<<
22031 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s)
22032 : *
22033 : */
22034 1774 : for (__pyx_t_1 = (__pyx_v_m - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
22035 1563 : __pyx_v_j = __pyx_t_1;
22036 :
22037 : /* "scipy/linalg/_decomp_update.pyx":918
22038 : *
22039 : * for j in range(m-2, -1, -1):
22040 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s) # <<<<<<<<<<<<<<
22041 : *
22042 : * # update jth and (j+1)th rows of r.
22043 : */
22044 1563 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
22045 :
22046 : /* "scipy/linalg/_decomp_update.pyx":921
22047 : *
22048 : * # update jth and (j+1)th rows of r.
22049 : * if n-j > 0: # <<<<<<<<<<<<<<
22050 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
22051 : *
22052 : */
22053 1563 : __pyx_t_2 = ((__pyx_v_n - __pyx_v_j) > 0);
22054 1563 : if (__pyx_t_2) {
22055 :
22056 : /* "scipy/linalg/_decomp_update.pyx":922
22057 : * # update jth and (j+1)th rows of r.
22058 : * if n-j > 0:
22059 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s) # <<<<<<<<<<<<<<
22060 : *
22061 : * # update jth and (j+1)th cols of q.
22062 : */
22063 1383 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
22064 :
22065 : /* "scipy/linalg/_decomp_update.pyx":921
22066 : *
22067 : * # update jth and (j+1)th rows of r.
22068 : * if n-j > 0: # <<<<<<<<<<<<<<
22069 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
22070 : *
22071 : */
22072 : }
22073 :
22074 : /* "scipy/linalg/_decomp_update.pyx":925
22075 : *
22076 : * # update jth and (j+1)th cols of q.
22077 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
22078 : *
22079 : * # add v to the first row
22080 : */
22081 1563 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
22082 : }
22083 :
22084 : /* "scipy/linalg/_decomp_update.pyx":928
22085 : *
22086 : * # add v to the first row
22087 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
22088 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1])
22089 : *
22090 : */
22091 211 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
22092 :
22093 : /* "scipy/linalg/_decomp_update.pyx":929
22094 : * # add v to the first row
22095 : * blas_t_conj(n, v, vs)
22096 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
22097 : *
22098 : * # return to q, r form
22099 : */
22100 211 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_u[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
22101 :
22102 : /* "scipy/linalg/_decomp_update.pyx":932
22103 : *
22104 : * # return to q, r form
22105 : * hessenberg_qr(m, n, q, qs, r, rs, 0) # <<<<<<<<<<<<<<
22106 : * # no return, return q, r from python driver.
22107 : *
22108 : */
22109 211 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0);
22110 :
22111 : /* "scipy/linalg/_decomp_update.pyx":901
22112 : * col(v, vs, j), vs, s, ss)
22113 : *
22114 : * cdef void qr_rank_1_update(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
22115 : * blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
22116 : * """ here we will assume that the u = Q.T.dot(u) and not the bare u.
22117 : */
22118 :
22119 : /* function exit code */
22120 211 : }
22121 :
22122 211 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_double_complex *__pyx_v_v, int *__pyx_v_vs) {
22123 211 : int __pyx_v_j;
22124 211 : __pyx_t_double_complex __pyx_v_c;
22125 211 : __pyx_t_double_complex __pyx_v_s;
22126 211 : int __pyx_t_1;
22127 211 : int __pyx_t_2;
22128 :
22129 : /* "scipy/linalg/_decomp_update.pyx":917
22130 : * # triangular.
22131 : *
22132 : * for j in range(m-2, -1, -1): # <<<<<<<<<<<<<<
22133 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s)
22134 : *
22135 : */
22136 1774 : for (__pyx_t_1 = (__pyx_v_m - 2); __pyx_t_1 > -1; __pyx_t_1-=1) {
22137 1563 : __pyx_v_j = __pyx_t_1;
22138 :
22139 : /* "scipy/linalg/_decomp_update.pyx":918
22140 : *
22141 : * for j in range(m-2, -1, -1):
22142 : * lartg(index1(u, us, j), index1(u, us, j+1), &c, &s) # <<<<<<<<<<<<<<
22143 : *
22144 : * # update jth and (j+1)th rows of r.
22145 : */
22146 1563 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index1(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1)), (&__pyx_v_c), (&__pyx_v_s));
22147 :
22148 : /* "scipy/linalg/_decomp_update.pyx":921
22149 : *
22150 : * # update jth and (j+1)th rows of r.
22151 : * if n-j > 0: # <<<<<<<<<<<<<<
22152 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
22153 : *
22154 : */
22155 1563 : __pyx_t_2 = ((__pyx_v_n - __pyx_v_j) > 0);
22156 1563 : if (__pyx_t_2) {
22157 :
22158 : /* "scipy/linalg/_decomp_update.pyx":922
22159 : * # update jth and (j+1)th rows of r.
22160 : * if n-j > 0:
22161 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s) # <<<<<<<<<<<<<<
22162 : *
22163 : * # update jth and (j+1)th cols of q.
22164 : */
22165 1383 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot((__pyx_v_n - __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
22166 :
22167 : /* "scipy/linalg/_decomp_update.pyx":921
22168 : *
22169 : * # update jth and (j+1)th rows of r.
22170 : * if n-j > 0: # <<<<<<<<<<<<<<
22171 : * rot(n-j, index2(r, rs, j, j), rs[1], index2(r, rs, j+1, j), rs[1], c, s)
22172 : *
22173 : */
22174 : }
22175 :
22176 : /* "scipy/linalg/_decomp_update.pyx":925
22177 : *
22178 : * # update jth and (j+1)th cols of q.
22179 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
22180 : *
22181 : * # add v to the first row
22182 : */
22183 1563 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
22184 : }
22185 :
22186 : /* "scipy/linalg/_decomp_update.pyx":928
22187 : *
22188 : * # add v to the first row
22189 : * blas_t_conj(n, v, vs) # <<<<<<<<<<<<<<
22190 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1])
22191 : *
22192 : */
22193 211 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_v, __pyx_v_vs);
22194 :
22195 : /* "scipy/linalg/_decomp_update.pyx":929
22196 : * # add v to the first row
22197 : * blas_t_conj(n, v, vs)
22198 : * axpy(n, u[0], v, vs[0], row(r, rs, 0), rs[1]) # <<<<<<<<<<<<<<
22199 : *
22200 : * # return to q, r form
22201 : */
22202 211 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, (__pyx_v_u[0]), __pyx_v_v, (__pyx_v_vs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, 0), (__pyx_v_rs[1]));
22203 :
22204 : /* "scipy/linalg/_decomp_update.pyx":932
22205 : *
22206 : * # return to q, r form
22207 : * hessenberg_qr(m, n, q, qs, r, rs, 0) # <<<<<<<<<<<<<<
22208 : * # no return, return q, r from python driver.
22209 : *
22210 : */
22211 211 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(__pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0);
22212 :
22213 : /* "scipy/linalg/_decomp_update.pyx":901
22214 : * col(v, vs, j), vs, s, ss)
22215 : *
22216 : * cdef void qr_rank_1_update(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
22217 : * blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
22218 : * """ here we will assume that the u = Q.T.dot(u) and not the bare u.
22219 : */
22220 :
22221 : /* function exit code */
22222 211 : }
22223 :
22224 : /* "scipy/linalg/_decomp_update.pyx":935
22225 : * # no return, return q, r from python driver.
22226 : *
22227 : * cdef int qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
22228 : * int* rs, blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
22229 : * cdef int i, j
22230 : */
22231 :
22232 211 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, float *__pyx_v_u, int *__pyx_v_us, float *__pyx_v_v, int *__pyx_v_vs) {
22233 211 : int __pyx_v_i;
22234 211 : int __pyx_v_j;
22235 211 : float __pyx_v_c;
22236 211 : float __pyx_v_s;
22237 211 : float *__pyx_v_tau;
22238 211 : float *__pyx_v_work;
22239 211 : int __pyx_v_info;
22240 211 : int __pyx_v_lwork;
22241 211 : char *__pyx_v_sideR;
22242 211 : char *__pyx_v_sideL;
22243 211 : char *__pyx_v_uplo;
22244 211 : char *__pyx_v_trans;
22245 211 : char *__pyx_v_diag;
22246 211 : int __pyx_r;
22247 211 : int __pyx_t_1;
22248 211 : int __pyx_t_2;
22249 211 : int __pyx_t_3;
22250 211 : int __pyx_t_4;
22251 211 : long __pyx_t_5;
22252 211 : long __pyx_t_6;
22253 211 : int __pyx_t_7;
22254 :
22255 : /* "scipy/linalg/_decomp_update.pyx":939
22256 : * cdef int i, j
22257 : * cdef blas_t c, s
22258 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
22259 : * cdef blas_t* work = NULL
22260 : * cdef int info, lwork
22261 : */
22262 211 : __pyx_v_tau = NULL;
22263 :
22264 : /* "scipy/linalg/_decomp_update.pyx":940
22265 : * cdef blas_t c, s
22266 : * cdef blas_t* tau = NULL
22267 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
22268 : * cdef int info, lwork
22269 : * cdef char* sideR = 'R'
22270 : */
22271 211 : __pyx_v_work = NULL;
22272 :
22273 : /* "scipy/linalg/_decomp_update.pyx":942
22274 : * cdef blas_t* work = NULL
22275 : * cdef int info, lwork
22276 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
22277 : * cdef char* sideL = 'L'
22278 : * cdef char* uplo = 'U'
22279 : */
22280 211 : __pyx_v_sideR = ((char *)"R");
22281 :
22282 : /* "scipy/linalg/_decomp_update.pyx":943
22283 : * cdef int info, lwork
22284 : * cdef char* sideR = 'R'
22285 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
22286 : * cdef char* uplo = 'U'
22287 : * cdef char* trans = 'N'
22288 : */
22289 211 : __pyx_v_sideL = ((char *)"L");
22290 :
22291 : /* "scipy/linalg/_decomp_update.pyx":944
22292 : * cdef char* sideR = 'R'
22293 : * cdef char* sideL = 'L'
22294 : * cdef char* uplo = 'U' # <<<<<<<<<<<<<<
22295 : * cdef char* trans = 'N'
22296 : * cdef char* diag = 'N'
22297 : */
22298 211 : __pyx_v_uplo = ((char *)"U");
22299 :
22300 : /* "scipy/linalg/_decomp_update.pyx":945
22301 : * cdef char* sideL = 'L'
22302 : * cdef char* uplo = 'U'
22303 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
22304 : * cdef char* diag = 'N'
22305 : *
22306 : */
22307 211 : __pyx_v_trans = ((char *)"N");
22308 :
22309 : /* "scipy/linalg/_decomp_update.pyx":946
22310 : * cdef char* uplo = 'U'
22311 : * cdef char* trans = 'N'
22312 : * cdef char* diag = 'N' # <<<<<<<<<<<<<<
22313 : *
22314 : * if m > n:
22315 : */
22316 211 : __pyx_v_diag = ((char *)"N");
22317 :
22318 : /* "scipy/linalg/_decomp_update.pyx":948
22319 : * cdef char* diag = 'N'
22320 : *
22321 : * if m > n: # <<<<<<<<<<<<<<
22322 : * # query the workspace
22323 : * # below p_subdiag_qr will need workspace of size m, which is the
22324 : */
22325 211 : __pyx_t_1 = (__pyx_v_m > __pyx_v_n);
22326 211 : if (__pyx_t_1) {
22327 :
22328 : /* "scipy/linalg/_decomp_update.pyx":953
22329 : * # minimum, ormqr will also require.
22330 : * # set tau to point at something, to keep new MKL working.
22331 : * tau = &c # <<<<<<<<<<<<<<
22332 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
22333 : * if info < 0:
22334 : */
22335 43 : __pyx_v_tau = (&__pyx_v_c);
22336 :
22337 : /* "scipy/linalg/_decomp_update.pyx":954
22338 : * # set tau to point at something, to keep new MKL working.
22339 : * tau = &c
22340 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1) # <<<<<<<<<<<<<<
22341 : * if info < 0:
22342 : * return libc.stdlib.abs(info)
22343 : */
22344 43 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
22345 :
22346 : /* "scipy/linalg/_decomp_update.pyx":955
22347 : * tau = &c
22348 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
22349 : * if info < 0: # <<<<<<<<<<<<<<
22350 : * return libc.stdlib.abs(info)
22351 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22352 : */
22353 43 : __pyx_t_1 = (__pyx_v_info < 0);
22354 43 : if (__pyx_t_1) {
22355 :
22356 : /* "scipy/linalg/_decomp_update.pyx":956
22357 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
22358 : * if info < 0:
22359 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
22360 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22361 : * index2(q, qs, 0, n), m, &s, -1)
22362 : */
22363 0 : __pyx_r = abs(__pyx_v_info);
22364 0 : goto __pyx_L0;
22365 :
22366 : /* "scipy/linalg/_decomp_update.pyx":955
22367 : * tau = &c
22368 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
22369 : * if info < 0: # <<<<<<<<<<<<<<
22370 : * return libc.stdlib.abs(info)
22371 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22372 : */
22373 : }
22374 :
22375 : /* "scipy/linalg/_decomp_update.pyx":957
22376 : * if info < 0:
22377 : * return libc.stdlib.abs(info)
22378 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
22379 : * index2(q, qs, 0, n), m, &s, -1)
22380 : * if info < 0:
22381 : */
22382 43 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, (&__pyx_v_s), -1);
22383 :
22384 : /* "scipy/linalg/_decomp_update.pyx":959
22385 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22386 : * index2(q, qs, 0, n), m, &s, -1)
22387 : * if info < 0: # <<<<<<<<<<<<<<
22388 : * return info
22389 : *
22390 : */
22391 43 : __pyx_t_1 = (__pyx_v_info < 0);
22392 43 : if (__pyx_t_1) {
22393 :
22394 : /* "scipy/linalg/_decomp_update.pyx":960
22395 : * index2(q, qs, 0, n), m, &s, -1)
22396 : * if info < 0:
22397 : * return info # <<<<<<<<<<<<<<
22398 : *
22399 : * # we're only doing one allocation, so use the larger
22400 : */
22401 0 : __pyx_r = __pyx_v_info;
22402 0 : goto __pyx_L0;
22403 :
22404 : /* "scipy/linalg/_decomp_update.pyx":959
22405 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22406 : * index2(q, qs, 0, n), m, &s, -1)
22407 : * if info < 0: # <<<<<<<<<<<<<<
22408 : * return info
22409 : *
22410 : */
22411 : }
22412 :
22413 : /* "scipy/linalg/_decomp_update.pyx":963
22414 : *
22415 : * # we're only doing one allocation, so use the larger
22416 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
22417 : *
22418 : * # allocate the workspace + tau
22419 : */
22420 43 : __pyx_v_lwork = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
22421 :
22422 : /* "scipy/linalg/_decomp_update.pyx":966
22423 : *
22424 : * # allocate the workspace + tau
22425 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
22426 : * if not work:
22427 : * return MEMORY_ERROR
22428 : */
22429 43 : __pyx_t_2 = __pyx_v_p;
22430 43 : __pyx_t_3 = (__pyx_v_m - __pyx_v_n);
22431 43 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
22432 43 : if (__pyx_t_1) {
22433 : __pyx_t_4 = __pyx_t_2;
22434 : } else {
22435 : __pyx_t_4 = __pyx_t_3;
22436 : }
22437 43 : __pyx_v_work = ((float *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(float)))));
22438 :
22439 : /* "scipy/linalg/_decomp_update.pyx":967
22440 : * # allocate the workspace + tau
22441 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
22442 : * if not work: # <<<<<<<<<<<<<<
22443 : * return MEMORY_ERROR
22444 : * tau = work + lwork
22445 : */
22446 43 : __pyx_t_1 = (!(__pyx_v_work != 0));
22447 43 : if (__pyx_t_1) {
22448 :
22449 : /* "scipy/linalg/_decomp_update.pyx":968
22450 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
22451 : * if not work:
22452 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
22453 : * tau = work + lwork
22454 : *
22455 : */
22456 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
22457 0 : goto __pyx_L0;
22458 :
22459 : /* "scipy/linalg/_decomp_update.pyx":967
22460 : * # allocate the workspace + tau
22461 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
22462 : * if not work: # <<<<<<<<<<<<<<
22463 : * return MEMORY_ERROR
22464 : * tau = work + lwork
22465 : */
22466 : }
22467 :
22468 : /* "scipy/linalg/_decomp_update.pyx":969
22469 : * if not work:
22470 : * return MEMORY_ERROR
22471 : * tau = work + lwork # <<<<<<<<<<<<<<
22472 : *
22473 : * # qr
22474 : */
22475 43 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
22476 :
22477 : /* "scipy/linalg/_decomp_update.pyx":972
22478 : *
22479 : * # qr
22480 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork) # <<<<<<<<<<<<<<
22481 : * if info < 0:
22482 : * libc.stdlib.free(work)
22483 : */
22484 43 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
22485 :
22486 : /* "scipy/linalg/_decomp_update.pyx":973
22487 : * # qr
22488 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
22489 : * if info < 0: # <<<<<<<<<<<<<<
22490 : * libc.stdlib.free(work)
22491 : * return libc.stdlib.abs(info)
22492 : */
22493 43 : __pyx_t_1 = (__pyx_v_info < 0);
22494 43 : if (__pyx_t_1) {
22495 :
22496 : /* "scipy/linalg/_decomp_update.pyx":974
22497 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
22498 : * if info < 0:
22499 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
22500 : * return libc.stdlib.abs(info)
22501 : *
22502 : */
22503 0 : free(__pyx_v_work);
22504 :
22505 : /* "scipy/linalg/_decomp_update.pyx":975
22506 : * if info < 0:
22507 : * libc.stdlib.free(work)
22508 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
22509 : *
22510 : * # apply the Q from this small qr to the last (m-n) columns of q.
22511 : */
22512 0 : __pyx_r = abs(__pyx_v_info);
22513 0 : goto __pyx_L0;
22514 :
22515 : /* "scipy/linalg/_decomp_update.pyx":973
22516 : * # qr
22517 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
22518 : * if info < 0: # <<<<<<<<<<<<<<
22519 : * libc.stdlib.free(work)
22520 : * return libc.stdlib.abs(info)
22521 : */
22522 : }
22523 :
22524 : /* "scipy/linalg/_decomp_update.pyx":978
22525 : *
22526 : * # apply the Q from this small qr to the last (m-n) columns of q.
22527 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
22528 : * index2(q, qs, 0, n), m, work, lwork)
22529 : * if info < 0:
22530 : */
22531 43 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
22532 :
22533 : /* "scipy/linalg/_decomp_update.pyx":980
22534 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22535 : * index2(q, qs, 0, n), m, work, lwork)
22536 : * if info < 0: # <<<<<<<<<<<<<<
22537 : * libc.stdlib.free(work)
22538 : * return info
22539 : */
22540 43 : __pyx_t_1 = (__pyx_v_info < 0);
22541 43 : if (__pyx_t_1) {
22542 :
22543 : /* "scipy/linalg/_decomp_update.pyx":981
22544 : * index2(q, qs, 0, n), m, work, lwork)
22545 : * if info < 0:
22546 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
22547 : * return info
22548 : *
22549 : */
22550 0 : free(__pyx_v_work);
22551 :
22552 : /* "scipy/linalg/_decomp_update.pyx":982
22553 : * if info < 0:
22554 : * libc.stdlib.free(work)
22555 : * return info # <<<<<<<<<<<<<<
22556 : *
22557 : * # reduce u the rest of the way to upper triangular using givens.
22558 : */
22559 0 : __pyx_r = __pyx_v_info;
22560 0 : goto __pyx_L0;
22561 :
22562 : /* "scipy/linalg/_decomp_update.pyx":980
22563 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22564 : * index2(q, qs, 0, n), m, work, lwork)
22565 : * if info < 0: # <<<<<<<<<<<<<<
22566 : * libc.stdlib.free(work)
22567 : * return info
22568 : */
22569 : }
22570 :
22571 : /* "scipy/linalg/_decomp_update.pyx":985
22572 : *
22573 : * # reduce u the rest of the way to upper triangular using givens.
22574 : * for i in range(p): # <<<<<<<<<<<<<<
22575 : * for j in range(n+i-1, i-1, -1):
22576 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22577 : */
22578 173 : __pyx_t_4 = __pyx_v_p;
22579 173 : __pyx_t_2 = __pyx_t_4;
22580 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
22581 130 : __pyx_v_i = __pyx_t_3;
22582 :
22583 : /* "scipy/linalg/_decomp_update.pyx":986
22584 : * # reduce u the rest of the way to upper triangular using givens.
22585 : * for i in range(p):
22586 : * for j in range(n+i-1, i-1, -1): # <<<<<<<<<<<<<<
22587 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22588 : * if p-i-1:
22589 : */
22590 130 : __pyx_t_5 = (__pyx_v_i - 1);
22591 130 : __pyx_t_6 = __pyx_t_5;
22592 1040 : for (__pyx_t_7 = ((__pyx_v_n + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
22593 910 : __pyx_v_j = __pyx_t_7;
22594 :
22595 : /* "scipy/linalg/_decomp_update.pyx":987
22596 : * for i in range(p):
22597 : * for j in range(n+i-1, i-1, -1):
22598 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
22599 : * if p-i-1:
22600 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22601 : */
22602 910 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
22603 :
22604 : /* "scipy/linalg/_decomp_update.pyx":988
22605 : * for j in range(n+i-1, i-1, -1):
22606 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22607 : * if p-i-1: # <<<<<<<<<<<<<<
22608 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22609 : * index2(u, us, j+1, i+1), us[1], c, s)
22610 : */
22611 910 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
22612 910 : if (__pyx_t_1) {
22613 :
22614 : /* "scipy/linalg/_decomp_update.pyx":989
22615 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22616 : * if p-i-1:
22617 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
22618 : * index2(u, us, j+1, i+1), us[1], c, s)
22619 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
22620 : */
22621 609 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
22622 :
22623 : /* "scipy/linalg/_decomp_update.pyx":988
22624 : * for j in range(n+i-1, i-1, -1):
22625 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22626 : * if p-i-1: # <<<<<<<<<<<<<<
22627 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22628 : * index2(u, us, j+1, i+1), us[1], c, s)
22629 : */
22630 : }
22631 :
22632 : /* "scipy/linalg/_decomp_update.pyx":991
22633 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22634 : * index2(u, us, j+1, i+1), us[1], c, s)
22635 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
22636 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
22637 : * c, s.conjugate())
22638 : */
22639 910 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
22640 :
22641 : /* "scipy/linalg/_decomp_update.pyx":992
22642 : * index2(u, us, j+1, i+1), us[1], c, s)
22643 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
22644 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
22645 : * c, s.conjugate())
22646 : *
22647 : */
22648 910 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
22649 : }
22650 : }
22651 :
22652 : /* "scipy/linalg/_decomp_update.pyx":948
22653 : * cdef char* diag = 'N'
22654 : *
22655 : * if m > n: # <<<<<<<<<<<<<<
22656 : * # query the workspace
22657 : * # below p_subdiag_qr will need workspace of size m, which is the
22658 : */
22659 43 : goto __pyx_L3;
22660 : }
22661 :
22662 : /* "scipy/linalg/_decomp_update.pyx":997
22663 : * else: # m == n or m < n
22664 : * # reduce u to upper triangular using givens.
22665 : * for i in range(p): # <<<<<<<<<<<<<<
22666 : * for j in range(m-2, i-1, -1):
22667 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22668 : */
22669 : /*else*/ {
22670 674 : __pyx_t_4 = __pyx_v_p;
22671 674 : __pyx_t_2 = __pyx_t_4;
22672 674 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
22673 506 : __pyx_v_i = __pyx_t_3;
22674 :
22675 : /* "scipy/linalg/_decomp_update.pyx":998
22676 : * # reduce u to upper triangular using givens.
22677 : * for i in range(p):
22678 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
22679 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22680 : * if p-i-1:
22681 : */
22682 506 : __pyx_t_5 = (__pyx_v_i - 1);
22683 506 : __pyx_t_6 = __pyx_t_5;
22684 3284 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
22685 2778 : __pyx_v_j = __pyx_t_7;
22686 :
22687 : /* "scipy/linalg/_decomp_update.pyx":999
22688 : * for i in range(p):
22689 : * for j in range(m-2, i-1, -1):
22690 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
22691 : * if p-i-1:
22692 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22693 : */
22694 2778 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
22695 :
22696 : /* "scipy/linalg/_decomp_update.pyx":1000
22697 : * for j in range(m-2, i-1, -1):
22698 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22699 : * if p-i-1: # <<<<<<<<<<<<<<
22700 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22701 : * index2(u, us, j+1, i+1), us[1], c, s)
22702 : */
22703 2778 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
22704 2778 : if (__pyx_t_1) {
22705 :
22706 : /* "scipy/linalg/_decomp_update.pyx":1001
22707 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22708 : * if p-i-1:
22709 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
22710 : * index2(u, us, j+1, i+1), us[1], c, s)
22711 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
22712 : */
22713 2023 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
22714 :
22715 : /* "scipy/linalg/_decomp_update.pyx":1000
22716 : * for j in range(m-2, i-1, -1):
22717 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
22718 : * if p-i-1: # <<<<<<<<<<<<<<
22719 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22720 : * index2(u, us, j+1, i+1), us[1], c, s)
22721 : */
22722 : }
22723 :
22724 : /* "scipy/linalg/_decomp_update.pyx":1003
22725 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
22726 : * index2(u, us, j+1, i+1), us[1], c, s)
22727 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
22728 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
22729 : * c, s.conjugate())
22730 : */
22731 2778 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
22732 :
22733 : /* "scipy/linalg/_decomp_update.pyx":1004
22734 : * index2(u, us, j+1, i+1), us[1], c, s)
22735 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
22736 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
22737 : * c, s.conjugate())
22738 : *
22739 : */
22740 2778 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
22741 : }
22742 : }
22743 :
22744 : /* "scipy/linalg/_decomp_update.pyx":1008
22745 : *
22746 : * # allocate workspace
22747 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t)) # <<<<<<<<<<<<<<
22748 : * if not work:
22749 : * return MEMORY_ERROR
22750 : */
22751 168 : __pyx_v_work = ((float *)malloc((__pyx_v_n * (sizeof(float)))));
22752 :
22753 : /* "scipy/linalg/_decomp_update.pyx":1009
22754 : * # allocate workspace
22755 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
22756 : * if not work: # <<<<<<<<<<<<<<
22757 : * return MEMORY_ERROR
22758 : *
22759 : */
22760 168 : __pyx_t_1 = (!(__pyx_v_work != 0));
22761 168 : if (__pyx_t_1) {
22762 :
22763 : /* "scipy/linalg/_decomp_update.pyx":1010
22764 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
22765 : * if not work:
22766 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
22767 : *
22768 : * # now form UV**H and add it to R.
22769 : */
22770 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
22771 0 : goto __pyx_L0;
22772 :
22773 : /* "scipy/linalg/_decomp_update.pyx":1009
22774 : * # allocate workspace
22775 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
22776 : * if not work: # <<<<<<<<<<<<<<
22777 : * return MEMORY_ERROR
22778 : *
22779 : */
22780 : }
22781 : }
22782 168 : __pyx_L3:;
22783 :
22784 : /* "scipy/linalg/_decomp_update.pyx":1014
22785 : * # now form UV**H and add it to R.
22786 : * # This won't fill in any more of R than we have already.
22787 : * blas_t_2d_conj(p, n, v, vs) # <<<<<<<<<<<<<<
22788 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p)
22789 : *
22790 : */
22791 211 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_p, __pyx_v_n, __pyx_v_v, __pyx_v_vs);
22792 :
22793 : /* "scipy/linalg/_decomp_update.pyx":1015
22794 : * # This won't fill in any more of R than we have already.
22795 : * blas_t_2d_conj(p, n, v, vs)
22796 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p) # <<<<<<<<<<<<<<
22797 : *
22798 : * # (should this be n, p length adds instead since these are fortran contig?)
22799 : */
22800 211 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_trmm(__pyx_v_sideL, __pyx_v_uplo, __pyx_v_trans, __pyx_v_diag, __pyx_v_p, __pyx_v_n, 1.0, __pyx_v_u, __pyx_v_m, __pyx_v_v, __pyx_v_p);
22801 :
22802 : /* "scipy/linalg/_decomp_update.pyx":1018
22803 : *
22804 : * # (should this be n, p length adds instead since these are fortran contig?)
22805 : * for j in range(p): # <<<<<<<<<<<<<<
22806 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1])
22807 : *
22808 : */
22809 211 : __pyx_t_4 = __pyx_v_p;
22810 211 : __pyx_t_2 = __pyx_t_4;
22811 847 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
22812 636 : __pyx_v_j = __pyx_t_3;
22813 :
22814 : /* "scipy/linalg/_decomp_update.pyx":1019
22815 : * # (should this be n, p length adds instead since these are fortran contig?)
22816 : * for j in range(p):
22817 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1]) # <<<<<<<<<<<<<<
22818 : *
22819 : * # now r has p subdiagonals, eliminate them with reflectors.
22820 : */
22821 636 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_v, __pyx_v_vs, __pyx_v_j), (__pyx_v_vs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]));
22822 : }
22823 :
22824 : /* "scipy/linalg/_decomp_update.pyx":1022
22825 : *
22826 : * # now r has p subdiagonals, eliminate them with reflectors.
22827 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work) # <<<<<<<<<<<<<<
22828 : *
22829 : * libc.stdlib.free(work)
22830 : */
22831 211 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0, __pyx_v_p, __pyx_v_work);
22832 :
22833 : /* "scipy/linalg/_decomp_update.pyx":1024
22834 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work)
22835 : *
22836 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
22837 : * return 0
22838 : *
22839 : */
22840 211 : free(__pyx_v_work);
22841 :
22842 : /* "scipy/linalg/_decomp_update.pyx":1025
22843 : *
22844 : * libc.stdlib.free(work)
22845 : * return 0 # <<<<<<<<<<<<<<
22846 : *
22847 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
22848 : */
22849 211 : __pyx_r = 0;
22850 211 : goto __pyx_L0;
22851 :
22852 : /* "scipy/linalg/_decomp_update.pyx":935
22853 : * # no return, return q, r from python driver.
22854 : *
22855 : * cdef int qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
22856 : * int* rs, blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
22857 : * cdef int i, j
22858 : */
22859 :
22860 : /* function exit code */
22861 211 : __pyx_L0:;
22862 211 : return __pyx_r;
22863 : }
22864 :
22865 211 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, double *__pyx_v_u, int *__pyx_v_us, double *__pyx_v_v, int *__pyx_v_vs) {
22866 211 : int __pyx_v_i;
22867 211 : int __pyx_v_j;
22868 211 : double __pyx_v_c;
22869 211 : double __pyx_v_s;
22870 211 : double *__pyx_v_tau;
22871 211 : double *__pyx_v_work;
22872 211 : int __pyx_v_info;
22873 211 : int __pyx_v_lwork;
22874 211 : char *__pyx_v_sideR;
22875 211 : char *__pyx_v_sideL;
22876 211 : char *__pyx_v_uplo;
22877 211 : char *__pyx_v_trans;
22878 211 : char *__pyx_v_diag;
22879 211 : int __pyx_r;
22880 211 : int __pyx_t_1;
22881 211 : int __pyx_t_2;
22882 211 : int __pyx_t_3;
22883 211 : int __pyx_t_4;
22884 211 : long __pyx_t_5;
22885 211 : long __pyx_t_6;
22886 211 : int __pyx_t_7;
22887 :
22888 : /* "scipy/linalg/_decomp_update.pyx":939
22889 : * cdef int i, j
22890 : * cdef blas_t c, s
22891 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
22892 : * cdef blas_t* work = NULL
22893 : * cdef int info, lwork
22894 : */
22895 211 : __pyx_v_tau = NULL;
22896 :
22897 : /* "scipy/linalg/_decomp_update.pyx":940
22898 : * cdef blas_t c, s
22899 : * cdef blas_t* tau = NULL
22900 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
22901 : * cdef int info, lwork
22902 : * cdef char* sideR = 'R'
22903 : */
22904 211 : __pyx_v_work = NULL;
22905 :
22906 : /* "scipy/linalg/_decomp_update.pyx":942
22907 : * cdef blas_t* work = NULL
22908 : * cdef int info, lwork
22909 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
22910 : * cdef char* sideL = 'L'
22911 : * cdef char* uplo = 'U'
22912 : */
22913 211 : __pyx_v_sideR = ((char *)"R");
22914 :
22915 : /* "scipy/linalg/_decomp_update.pyx":943
22916 : * cdef int info, lwork
22917 : * cdef char* sideR = 'R'
22918 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
22919 : * cdef char* uplo = 'U'
22920 : * cdef char* trans = 'N'
22921 : */
22922 211 : __pyx_v_sideL = ((char *)"L");
22923 :
22924 : /* "scipy/linalg/_decomp_update.pyx":944
22925 : * cdef char* sideR = 'R'
22926 : * cdef char* sideL = 'L'
22927 : * cdef char* uplo = 'U' # <<<<<<<<<<<<<<
22928 : * cdef char* trans = 'N'
22929 : * cdef char* diag = 'N'
22930 : */
22931 211 : __pyx_v_uplo = ((char *)"U");
22932 :
22933 : /* "scipy/linalg/_decomp_update.pyx":945
22934 : * cdef char* sideL = 'L'
22935 : * cdef char* uplo = 'U'
22936 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
22937 : * cdef char* diag = 'N'
22938 : *
22939 : */
22940 211 : __pyx_v_trans = ((char *)"N");
22941 :
22942 : /* "scipy/linalg/_decomp_update.pyx":946
22943 : * cdef char* uplo = 'U'
22944 : * cdef char* trans = 'N'
22945 : * cdef char* diag = 'N' # <<<<<<<<<<<<<<
22946 : *
22947 : * if m > n:
22948 : */
22949 211 : __pyx_v_diag = ((char *)"N");
22950 :
22951 : /* "scipy/linalg/_decomp_update.pyx":948
22952 : * cdef char* diag = 'N'
22953 : *
22954 : * if m > n: # <<<<<<<<<<<<<<
22955 : * # query the workspace
22956 : * # below p_subdiag_qr will need workspace of size m, which is the
22957 : */
22958 211 : __pyx_t_1 = (__pyx_v_m > __pyx_v_n);
22959 211 : if (__pyx_t_1) {
22960 :
22961 : /* "scipy/linalg/_decomp_update.pyx":953
22962 : * # minimum, ormqr will also require.
22963 : * # set tau to point at something, to keep new MKL working.
22964 : * tau = &c # <<<<<<<<<<<<<<
22965 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
22966 : * if info < 0:
22967 : */
22968 43 : __pyx_v_tau = (&__pyx_v_c);
22969 :
22970 : /* "scipy/linalg/_decomp_update.pyx":954
22971 : * # set tau to point at something, to keep new MKL working.
22972 : * tau = &c
22973 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1) # <<<<<<<<<<<<<<
22974 : * if info < 0:
22975 : * return libc.stdlib.abs(info)
22976 : */
22977 43 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
22978 :
22979 : /* "scipy/linalg/_decomp_update.pyx":955
22980 : * tau = &c
22981 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
22982 : * if info < 0: # <<<<<<<<<<<<<<
22983 : * return libc.stdlib.abs(info)
22984 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22985 : */
22986 43 : __pyx_t_1 = (__pyx_v_info < 0);
22987 43 : if (__pyx_t_1) {
22988 :
22989 : /* "scipy/linalg/_decomp_update.pyx":956
22990 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
22991 : * if info < 0:
22992 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
22993 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
22994 : * index2(q, qs, 0, n), m, &s, -1)
22995 : */
22996 0 : __pyx_r = abs(__pyx_v_info);
22997 0 : goto __pyx_L0;
22998 :
22999 : /* "scipy/linalg/_decomp_update.pyx":955
23000 : * tau = &c
23001 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
23002 : * if info < 0: # <<<<<<<<<<<<<<
23003 : * return libc.stdlib.abs(info)
23004 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23005 : */
23006 : }
23007 :
23008 : /* "scipy/linalg/_decomp_update.pyx":957
23009 : * if info < 0:
23010 : * return libc.stdlib.abs(info)
23011 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
23012 : * index2(q, qs, 0, n), m, &s, -1)
23013 : * if info < 0:
23014 : */
23015 43 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, (&__pyx_v_s), -1);
23016 :
23017 : /* "scipy/linalg/_decomp_update.pyx":959
23018 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23019 : * index2(q, qs, 0, n), m, &s, -1)
23020 : * if info < 0: # <<<<<<<<<<<<<<
23021 : * return info
23022 : *
23023 : */
23024 43 : __pyx_t_1 = (__pyx_v_info < 0);
23025 43 : if (__pyx_t_1) {
23026 :
23027 : /* "scipy/linalg/_decomp_update.pyx":960
23028 : * index2(q, qs, 0, n), m, &s, -1)
23029 : * if info < 0:
23030 : * return info # <<<<<<<<<<<<<<
23031 : *
23032 : * # we're only doing one allocation, so use the larger
23033 : */
23034 0 : __pyx_r = __pyx_v_info;
23035 0 : goto __pyx_L0;
23036 :
23037 : /* "scipy/linalg/_decomp_update.pyx":959
23038 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23039 : * index2(q, qs, 0, n), m, &s, -1)
23040 : * if info < 0: # <<<<<<<<<<<<<<
23041 : * return info
23042 : *
23043 : */
23044 : }
23045 :
23046 : /* "scipy/linalg/_decomp_update.pyx":963
23047 : *
23048 : * # we're only doing one allocation, so use the larger
23049 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
23050 : *
23051 : * # allocate the workspace + tau
23052 : */
23053 43 : __pyx_v_lwork = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
23054 :
23055 : /* "scipy/linalg/_decomp_update.pyx":966
23056 : *
23057 : * # allocate the workspace + tau
23058 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
23059 : * if not work:
23060 : * return MEMORY_ERROR
23061 : */
23062 43 : __pyx_t_2 = __pyx_v_p;
23063 43 : __pyx_t_3 = (__pyx_v_m - __pyx_v_n);
23064 43 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
23065 43 : if (__pyx_t_1) {
23066 : __pyx_t_4 = __pyx_t_2;
23067 : } else {
23068 : __pyx_t_4 = __pyx_t_3;
23069 : }
23070 43 : __pyx_v_work = ((double *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(double)))));
23071 :
23072 : /* "scipy/linalg/_decomp_update.pyx":967
23073 : * # allocate the workspace + tau
23074 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
23075 : * if not work: # <<<<<<<<<<<<<<
23076 : * return MEMORY_ERROR
23077 : * tau = work + lwork
23078 : */
23079 43 : __pyx_t_1 = (!(__pyx_v_work != 0));
23080 43 : if (__pyx_t_1) {
23081 :
23082 : /* "scipy/linalg/_decomp_update.pyx":968
23083 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
23084 : * if not work:
23085 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
23086 : * tau = work + lwork
23087 : *
23088 : */
23089 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
23090 0 : goto __pyx_L0;
23091 :
23092 : /* "scipy/linalg/_decomp_update.pyx":967
23093 : * # allocate the workspace + tau
23094 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
23095 : * if not work: # <<<<<<<<<<<<<<
23096 : * return MEMORY_ERROR
23097 : * tau = work + lwork
23098 : */
23099 : }
23100 :
23101 : /* "scipy/linalg/_decomp_update.pyx":969
23102 : * if not work:
23103 : * return MEMORY_ERROR
23104 : * tau = work + lwork # <<<<<<<<<<<<<<
23105 : *
23106 : * # qr
23107 : */
23108 43 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
23109 :
23110 : /* "scipy/linalg/_decomp_update.pyx":972
23111 : *
23112 : * # qr
23113 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork) # <<<<<<<<<<<<<<
23114 : * if info < 0:
23115 : * libc.stdlib.free(work)
23116 : */
23117 43 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
23118 :
23119 : /* "scipy/linalg/_decomp_update.pyx":973
23120 : * # qr
23121 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
23122 : * if info < 0: # <<<<<<<<<<<<<<
23123 : * libc.stdlib.free(work)
23124 : * return libc.stdlib.abs(info)
23125 : */
23126 43 : __pyx_t_1 = (__pyx_v_info < 0);
23127 43 : if (__pyx_t_1) {
23128 :
23129 : /* "scipy/linalg/_decomp_update.pyx":974
23130 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
23131 : * if info < 0:
23132 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
23133 : * return libc.stdlib.abs(info)
23134 : *
23135 : */
23136 0 : free(__pyx_v_work);
23137 :
23138 : /* "scipy/linalg/_decomp_update.pyx":975
23139 : * if info < 0:
23140 : * libc.stdlib.free(work)
23141 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
23142 : *
23143 : * # apply the Q from this small qr to the last (m-n) columns of q.
23144 : */
23145 0 : __pyx_r = abs(__pyx_v_info);
23146 0 : goto __pyx_L0;
23147 :
23148 : /* "scipy/linalg/_decomp_update.pyx":973
23149 : * # qr
23150 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
23151 : * if info < 0: # <<<<<<<<<<<<<<
23152 : * libc.stdlib.free(work)
23153 : * return libc.stdlib.abs(info)
23154 : */
23155 : }
23156 :
23157 : /* "scipy/linalg/_decomp_update.pyx":978
23158 : *
23159 : * # apply the Q from this small qr to the last (m-n) columns of q.
23160 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
23161 : * index2(q, qs, 0, n), m, work, lwork)
23162 : * if info < 0:
23163 : */
23164 43 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
23165 :
23166 : /* "scipy/linalg/_decomp_update.pyx":980
23167 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23168 : * index2(q, qs, 0, n), m, work, lwork)
23169 : * if info < 0: # <<<<<<<<<<<<<<
23170 : * libc.stdlib.free(work)
23171 : * return info
23172 : */
23173 43 : __pyx_t_1 = (__pyx_v_info < 0);
23174 43 : if (__pyx_t_1) {
23175 :
23176 : /* "scipy/linalg/_decomp_update.pyx":981
23177 : * index2(q, qs, 0, n), m, work, lwork)
23178 : * if info < 0:
23179 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
23180 : * return info
23181 : *
23182 : */
23183 0 : free(__pyx_v_work);
23184 :
23185 : /* "scipy/linalg/_decomp_update.pyx":982
23186 : * if info < 0:
23187 : * libc.stdlib.free(work)
23188 : * return info # <<<<<<<<<<<<<<
23189 : *
23190 : * # reduce u the rest of the way to upper triangular using givens.
23191 : */
23192 0 : __pyx_r = __pyx_v_info;
23193 0 : goto __pyx_L0;
23194 :
23195 : /* "scipy/linalg/_decomp_update.pyx":980
23196 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23197 : * index2(q, qs, 0, n), m, work, lwork)
23198 : * if info < 0: # <<<<<<<<<<<<<<
23199 : * libc.stdlib.free(work)
23200 : * return info
23201 : */
23202 : }
23203 :
23204 : /* "scipy/linalg/_decomp_update.pyx":985
23205 : *
23206 : * # reduce u the rest of the way to upper triangular using givens.
23207 : * for i in range(p): # <<<<<<<<<<<<<<
23208 : * for j in range(n+i-1, i-1, -1):
23209 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23210 : */
23211 173 : __pyx_t_4 = __pyx_v_p;
23212 173 : __pyx_t_2 = __pyx_t_4;
23213 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23214 130 : __pyx_v_i = __pyx_t_3;
23215 :
23216 : /* "scipy/linalg/_decomp_update.pyx":986
23217 : * # reduce u the rest of the way to upper triangular using givens.
23218 : * for i in range(p):
23219 : * for j in range(n+i-1, i-1, -1): # <<<<<<<<<<<<<<
23220 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23221 : * if p-i-1:
23222 : */
23223 130 : __pyx_t_5 = (__pyx_v_i - 1);
23224 130 : __pyx_t_6 = __pyx_t_5;
23225 1040 : for (__pyx_t_7 = ((__pyx_v_n + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
23226 910 : __pyx_v_j = __pyx_t_7;
23227 :
23228 : /* "scipy/linalg/_decomp_update.pyx":987
23229 : * for i in range(p):
23230 : * for j in range(n+i-1, i-1, -1):
23231 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
23232 : * if p-i-1:
23233 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23234 : */
23235 910 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
23236 :
23237 : /* "scipy/linalg/_decomp_update.pyx":988
23238 : * for j in range(n+i-1, i-1, -1):
23239 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23240 : * if p-i-1: # <<<<<<<<<<<<<<
23241 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23242 : * index2(u, us, j+1, i+1), us[1], c, s)
23243 : */
23244 910 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
23245 910 : if (__pyx_t_1) {
23246 :
23247 : /* "scipy/linalg/_decomp_update.pyx":989
23248 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23249 : * if p-i-1:
23250 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
23251 : * index2(u, us, j+1, i+1), us[1], c, s)
23252 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
23253 : */
23254 609 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
23255 :
23256 : /* "scipy/linalg/_decomp_update.pyx":988
23257 : * for j in range(n+i-1, i-1, -1):
23258 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23259 : * if p-i-1: # <<<<<<<<<<<<<<
23260 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23261 : * index2(u, us, j+1, i+1), us[1], c, s)
23262 : */
23263 : }
23264 :
23265 : /* "scipy/linalg/_decomp_update.pyx":991
23266 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23267 : * index2(u, us, j+1, i+1), us[1], c, s)
23268 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
23269 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
23270 : * c, s.conjugate())
23271 : */
23272 910 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
23273 :
23274 : /* "scipy/linalg/_decomp_update.pyx":992
23275 : * index2(u, us, j+1, i+1), us[1], c, s)
23276 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
23277 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
23278 : * c, s.conjugate())
23279 : *
23280 : */
23281 910 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
23282 : }
23283 : }
23284 :
23285 : /* "scipy/linalg/_decomp_update.pyx":948
23286 : * cdef char* diag = 'N'
23287 : *
23288 : * if m > n: # <<<<<<<<<<<<<<
23289 : * # query the workspace
23290 : * # below p_subdiag_qr will need workspace of size m, which is the
23291 : */
23292 43 : goto __pyx_L3;
23293 : }
23294 :
23295 : /* "scipy/linalg/_decomp_update.pyx":997
23296 : * else: # m == n or m < n
23297 : * # reduce u to upper triangular using givens.
23298 : * for i in range(p): # <<<<<<<<<<<<<<
23299 : * for j in range(m-2, i-1, -1):
23300 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23301 : */
23302 : /*else*/ {
23303 674 : __pyx_t_4 = __pyx_v_p;
23304 674 : __pyx_t_2 = __pyx_t_4;
23305 674 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23306 506 : __pyx_v_i = __pyx_t_3;
23307 :
23308 : /* "scipy/linalg/_decomp_update.pyx":998
23309 : * # reduce u to upper triangular using givens.
23310 : * for i in range(p):
23311 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
23312 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23313 : * if p-i-1:
23314 : */
23315 506 : __pyx_t_5 = (__pyx_v_i - 1);
23316 506 : __pyx_t_6 = __pyx_t_5;
23317 3284 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
23318 2778 : __pyx_v_j = __pyx_t_7;
23319 :
23320 : /* "scipy/linalg/_decomp_update.pyx":999
23321 : * for i in range(p):
23322 : * for j in range(m-2, i-1, -1):
23323 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
23324 : * if p-i-1:
23325 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23326 : */
23327 2778 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
23328 :
23329 : /* "scipy/linalg/_decomp_update.pyx":1000
23330 : * for j in range(m-2, i-1, -1):
23331 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23332 : * if p-i-1: # <<<<<<<<<<<<<<
23333 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23334 : * index2(u, us, j+1, i+1), us[1], c, s)
23335 : */
23336 2778 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
23337 2778 : if (__pyx_t_1) {
23338 :
23339 : /* "scipy/linalg/_decomp_update.pyx":1001
23340 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23341 : * if p-i-1:
23342 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
23343 : * index2(u, us, j+1, i+1), us[1], c, s)
23344 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
23345 : */
23346 2023 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
23347 :
23348 : /* "scipy/linalg/_decomp_update.pyx":1000
23349 : * for j in range(m-2, i-1, -1):
23350 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23351 : * if p-i-1: # <<<<<<<<<<<<<<
23352 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23353 : * index2(u, us, j+1, i+1), us[1], c, s)
23354 : */
23355 : }
23356 :
23357 : /* "scipy/linalg/_decomp_update.pyx":1003
23358 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23359 : * index2(u, us, j+1, i+1), us[1], c, s)
23360 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
23361 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
23362 : * c, s.conjugate())
23363 : */
23364 2778 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
23365 :
23366 : /* "scipy/linalg/_decomp_update.pyx":1004
23367 : * index2(u, us, j+1, i+1), us[1], c, s)
23368 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
23369 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
23370 : * c, s.conjugate())
23371 : *
23372 : */
23373 2778 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
23374 : }
23375 : }
23376 :
23377 : /* "scipy/linalg/_decomp_update.pyx":1008
23378 : *
23379 : * # allocate workspace
23380 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t)) # <<<<<<<<<<<<<<
23381 : * if not work:
23382 : * return MEMORY_ERROR
23383 : */
23384 168 : __pyx_v_work = ((double *)malloc((__pyx_v_n * (sizeof(double)))));
23385 :
23386 : /* "scipy/linalg/_decomp_update.pyx":1009
23387 : * # allocate workspace
23388 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
23389 : * if not work: # <<<<<<<<<<<<<<
23390 : * return MEMORY_ERROR
23391 : *
23392 : */
23393 168 : __pyx_t_1 = (!(__pyx_v_work != 0));
23394 168 : if (__pyx_t_1) {
23395 :
23396 : /* "scipy/linalg/_decomp_update.pyx":1010
23397 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
23398 : * if not work:
23399 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
23400 : *
23401 : * # now form UV**H and add it to R.
23402 : */
23403 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
23404 0 : goto __pyx_L0;
23405 :
23406 : /* "scipy/linalg/_decomp_update.pyx":1009
23407 : * # allocate workspace
23408 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
23409 : * if not work: # <<<<<<<<<<<<<<
23410 : * return MEMORY_ERROR
23411 : *
23412 : */
23413 : }
23414 : }
23415 168 : __pyx_L3:;
23416 :
23417 : /* "scipy/linalg/_decomp_update.pyx":1014
23418 : * # now form UV**H and add it to R.
23419 : * # This won't fill in any more of R than we have already.
23420 : * blas_t_2d_conj(p, n, v, vs) # <<<<<<<<<<<<<<
23421 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p)
23422 : *
23423 : */
23424 211 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_p, __pyx_v_n, __pyx_v_v, __pyx_v_vs);
23425 :
23426 : /* "scipy/linalg/_decomp_update.pyx":1015
23427 : * # This won't fill in any more of R than we have already.
23428 : * blas_t_2d_conj(p, n, v, vs)
23429 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p) # <<<<<<<<<<<<<<
23430 : *
23431 : * # (should this be n, p length adds instead since these are fortran contig?)
23432 : */
23433 211 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_trmm(__pyx_v_sideL, __pyx_v_uplo, __pyx_v_trans, __pyx_v_diag, __pyx_v_p, __pyx_v_n, 1.0, __pyx_v_u, __pyx_v_m, __pyx_v_v, __pyx_v_p);
23434 :
23435 : /* "scipy/linalg/_decomp_update.pyx":1018
23436 : *
23437 : * # (should this be n, p length adds instead since these are fortran contig?)
23438 : * for j in range(p): # <<<<<<<<<<<<<<
23439 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1])
23440 : *
23441 : */
23442 211 : __pyx_t_4 = __pyx_v_p;
23443 211 : __pyx_t_2 = __pyx_t_4;
23444 847 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23445 636 : __pyx_v_j = __pyx_t_3;
23446 :
23447 : /* "scipy/linalg/_decomp_update.pyx":1019
23448 : * # (should this be n, p length adds instead since these are fortran contig?)
23449 : * for j in range(p):
23450 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1]) # <<<<<<<<<<<<<<
23451 : *
23452 : * # now r has p subdiagonals, eliminate them with reflectors.
23453 : */
23454 636 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_v, __pyx_v_vs, __pyx_v_j), (__pyx_v_vs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]));
23455 : }
23456 :
23457 : /* "scipy/linalg/_decomp_update.pyx":1022
23458 : *
23459 : * # now r has p subdiagonals, eliminate them with reflectors.
23460 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work) # <<<<<<<<<<<<<<
23461 : *
23462 : * libc.stdlib.free(work)
23463 : */
23464 211 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0, __pyx_v_p, __pyx_v_work);
23465 :
23466 : /* "scipy/linalg/_decomp_update.pyx":1024
23467 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work)
23468 : *
23469 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
23470 : * return 0
23471 : *
23472 : */
23473 211 : free(__pyx_v_work);
23474 :
23475 : /* "scipy/linalg/_decomp_update.pyx":1025
23476 : *
23477 : * libc.stdlib.free(work)
23478 : * return 0 # <<<<<<<<<<<<<<
23479 : *
23480 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
23481 : */
23482 211 : __pyx_r = 0;
23483 211 : goto __pyx_L0;
23484 :
23485 : /* "scipy/linalg/_decomp_update.pyx":935
23486 : * # no return, return q, r from python driver.
23487 : *
23488 : * cdef int qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
23489 : * int* rs, blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
23490 : * cdef int i, j
23491 : */
23492 :
23493 : /* function exit code */
23494 211 : __pyx_L0:;
23495 211 : return __pyx_r;
23496 : }
23497 :
23498 211 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_float_complex *__pyx_v_v, int *__pyx_v_vs) {
23499 211 : int __pyx_v_i;
23500 211 : int __pyx_v_j;
23501 211 : __pyx_t_float_complex __pyx_v_c;
23502 211 : __pyx_t_float_complex __pyx_v_s;
23503 211 : __pyx_t_float_complex *__pyx_v_tau;
23504 211 : __pyx_t_float_complex *__pyx_v_work;
23505 211 : int __pyx_v_info;
23506 211 : int __pyx_v_lwork;
23507 211 : char *__pyx_v_sideR;
23508 211 : char *__pyx_v_sideL;
23509 211 : char *__pyx_v_uplo;
23510 211 : char *__pyx_v_trans;
23511 211 : char *__pyx_v_diag;
23512 211 : int __pyx_r;
23513 211 : int __pyx_t_1;
23514 211 : int __pyx_t_2;
23515 211 : int __pyx_t_3;
23516 211 : int __pyx_t_4;
23517 211 : long __pyx_t_5;
23518 211 : long __pyx_t_6;
23519 211 : int __pyx_t_7;
23520 :
23521 : /* "scipy/linalg/_decomp_update.pyx":939
23522 : * cdef int i, j
23523 : * cdef blas_t c, s
23524 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
23525 : * cdef blas_t* work = NULL
23526 : * cdef int info, lwork
23527 : */
23528 211 : __pyx_v_tau = NULL;
23529 :
23530 : /* "scipy/linalg/_decomp_update.pyx":940
23531 : * cdef blas_t c, s
23532 : * cdef blas_t* tau = NULL
23533 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
23534 : * cdef int info, lwork
23535 : * cdef char* sideR = 'R'
23536 : */
23537 211 : __pyx_v_work = NULL;
23538 :
23539 : /* "scipy/linalg/_decomp_update.pyx":942
23540 : * cdef blas_t* work = NULL
23541 : * cdef int info, lwork
23542 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
23543 : * cdef char* sideL = 'L'
23544 : * cdef char* uplo = 'U'
23545 : */
23546 211 : __pyx_v_sideR = ((char *)"R");
23547 :
23548 : /* "scipy/linalg/_decomp_update.pyx":943
23549 : * cdef int info, lwork
23550 : * cdef char* sideR = 'R'
23551 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
23552 : * cdef char* uplo = 'U'
23553 : * cdef char* trans = 'N'
23554 : */
23555 211 : __pyx_v_sideL = ((char *)"L");
23556 :
23557 : /* "scipy/linalg/_decomp_update.pyx":944
23558 : * cdef char* sideR = 'R'
23559 : * cdef char* sideL = 'L'
23560 : * cdef char* uplo = 'U' # <<<<<<<<<<<<<<
23561 : * cdef char* trans = 'N'
23562 : * cdef char* diag = 'N'
23563 : */
23564 211 : __pyx_v_uplo = ((char *)"U");
23565 :
23566 : /* "scipy/linalg/_decomp_update.pyx":945
23567 : * cdef char* sideL = 'L'
23568 : * cdef char* uplo = 'U'
23569 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
23570 : * cdef char* diag = 'N'
23571 : *
23572 : */
23573 211 : __pyx_v_trans = ((char *)"N");
23574 :
23575 : /* "scipy/linalg/_decomp_update.pyx":946
23576 : * cdef char* uplo = 'U'
23577 : * cdef char* trans = 'N'
23578 : * cdef char* diag = 'N' # <<<<<<<<<<<<<<
23579 : *
23580 : * if m > n:
23581 : */
23582 211 : __pyx_v_diag = ((char *)"N");
23583 :
23584 : /* "scipy/linalg/_decomp_update.pyx":948
23585 : * cdef char* diag = 'N'
23586 : *
23587 : * if m > n: # <<<<<<<<<<<<<<
23588 : * # query the workspace
23589 : * # below p_subdiag_qr will need workspace of size m, which is the
23590 : */
23591 211 : __pyx_t_1 = (__pyx_v_m > __pyx_v_n);
23592 211 : if (__pyx_t_1) {
23593 :
23594 : /* "scipy/linalg/_decomp_update.pyx":953
23595 : * # minimum, ormqr will also require.
23596 : * # set tau to point at something, to keep new MKL working.
23597 : * tau = &c # <<<<<<<<<<<<<<
23598 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
23599 : * if info < 0:
23600 : */
23601 43 : __pyx_v_tau = (&__pyx_v_c);
23602 :
23603 : /* "scipy/linalg/_decomp_update.pyx":954
23604 : * # set tau to point at something, to keep new MKL working.
23605 : * tau = &c
23606 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1) # <<<<<<<<<<<<<<
23607 : * if info < 0:
23608 : * return libc.stdlib.abs(info)
23609 : */
23610 43 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
23611 :
23612 : /* "scipy/linalg/_decomp_update.pyx":955
23613 : * tau = &c
23614 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
23615 : * if info < 0: # <<<<<<<<<<<<<<
23616 : * return libc.stdlib.abs(info)
23617 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23618 : */
23619 43 : __pyx_t_1 = (__pyx_v_info < 0);
23620 43 : if (__pyx_t_1) {
23621 :
23622 : /* "scipy/linalg/_decomp_update.pyx":956
23623 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
23624 : * if info < 0:
23625 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
23626 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23627 : * index2(q, qs, 0, n), m, &s, -1)
23628 : */
23629 0 : __pyx_r = abs(__pyx_v_info);
23630 0 : goto __pyx_L0;
23631 :
23632 : /* "scipy/linalg/_decomp_update.pyx":955
23633 : * tau = &c
23634 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
23635 : * if info < 0: # <<<<<<<<<<<<<<
23636 : * return libc.stdlib.abs(info)
23637 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23638 : */
23639 : }
23640 :
23641 : /* "scipy/linalg/_decomp_update.pyx":957
23642 : * if info < 0:
23643 : * return libc.stdlib.abs(info)
23644 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
23645 : * index2(q, qs, 0, n), m, &s, -1)
23646 : * if info < 0:
23647 : */
23648 43 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, (&__pyx_v_s), -1);
23649 :
23650 : /* "scipy/linalg/_decomp_update.pyx":959
23651 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23652 : * index2(q, qs, 0, n), m, &s, -1)
23653 : * if info < 0: # <<<<<<<<<<<<<<
23654 : * return info
23655 : *
23656 : */
23657 43 : __pyx_t_1 = (__pyx_v_info < 0);
23658 43 : if (__pyx_t_1) {
23659 :
23660 : /* "scipy/linalg/_decomp_update.pyx":960
23661 : * index2(q, qs, 0, n), m, &s, -1)
23662 : * if info < 0:
23663 : * return info # <<<<<<<<<<<<<<
23664 : *
23665 : * # we're only doing one allocation, so use the larger
23666 : */
23667 0 : __pyx_r = __pyx_v_info;
23668 0 : goto __pyx_L0;
23669 :
23670 : /* "scipy/linalg/_decomp_update.pyx":959
23671 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23672 : * index2(q, qs, 0, n), m, &s, -1)
23673 : * if info < 0: # <<<<<<<<<<<<<<
23674 : * return info
23675 : *
23676 : */
23677 : }
23678 :
23679 : /* "scipy/linalg/_decomp_update.pyx":963
23680 : *
23681 : * # we're only doing one allocation, so use the larger
23682 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
23683 : *
23684 : * # allocate the workspace + tau
23685 : */
23686 43 : __pyx_v_lwork = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
23687 :
23688 : /* "scipy/linalg/_decomp_update.pyx":966
23689 : *
23690 : * # allocate the workspace + tau
23691 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
23692 : * if not work:
23693 : * return MEMORY_ERROR
23694 : */
23695 43 : __pyx_t_2 = __pyx_v_p;
23696 43 : __pyx_t_3 = (__pyx_v_m - __pyx_v_n);
23697 43 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
23698 43 : if (__pyx_t_1) {
23699 : __pyx_t_4 = __pyx_t_2;
23700 : } else {
23701 : __pyx_t_4 = __pyx_t_3;
23702 : }
23703 43 : __pyx_v_work = ((__pyx_t_float_complex *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(__pyx_t_float_complex)))));
23704 :
23705 : /* "scipy/linalg/_decomp_update.pyx":967
23706 : * # allocate the workspace + tau
23707 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
23708 : * if not work: # <<<<<<<<<<<<<<
23709 : * return MEMORY_ERROR
23710 : * tau = work + lwork
23711 : */
23712 43 : __pyx_t_1 = (!(__pyx_v_work != 0));
23713 43 : if (__pyx_t_1) {
23714 :
23715 : /* "scipy/linalg/_decomp_update.pyx":968
23716 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
23717 : * if not work:
23718 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
23719 : * tau = work + lwork
23720 : *
23721 : */
23722 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
23723 0 : goto __pyx_L0;
23724 :
23725 : /* "scipy/linalg/_decomp_update.pyx":967
23726 : * # allocate the workspace + tau
23727 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
23728 : * if not work: # <<<<<<<<<<<<<<
23729 : * return MEMORY_ERROR
23730 : * tau = work + lwork
23731 : */
23732 : }
23733 :
23734 : /* "scipy/linalg/_decomp_update.pyx":969
23735 : * if not work:
23736 : * return MEMORY_ERROR
23737 : * tau = work + lwork # <<<<<<<<<<<<<<
23738 : *
23739 : * # qr
23740 : */
23741 43 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
23742 :
23743 : /* "scipy/linalg/_decomp_update.pyx":972
23744 : *
23745 : * # qr
23746 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork) # <<<<<<<<<<<<<<
23747 : * if info < 0:
23748 : * libc.stdlib.free(work)
23749 : */
23750 43 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
23751 :
23752 : /* "scipy/linalg/_decomp_update.pyx":973
23753 : * # qr
23754 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
23755 : * if info < 0: # <<<<<<<<<<<<<<
23756 : * libc.stdlib.free(work)
23757 : * return libc.stdlib.abs(info)
23758 : */
23759 43 : __pyx_t_1 = (__pyx_v_info < 0);
23760 43 : if (__pyx_t_1) {
23761 :
23762 : /* "scipy/linalg/_decomp_update.pyx":974
23763 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
23764 : * if info < 0:
23765 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
23766 : * return libc.stdlib.abs(info)
23767 : *
23768 : */
23769 0 : free(__pyx_v_work);
23770 :
23771 : /* "scipy/linalg/_decomp_update.pyx":975
23772 : * if info < 0:
23773 : * libc.stdlib.free(work)
23774 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
23775 : *
23776 : * # apply the Q from this small qr to the last (m-n) columns of q.
23777 : */
23778 0 : __pyx_r = abs(__pyx_v_info);
23779 0 : goto __pyx_L0;
23780 :
23781 : /* "scipy/linalg/_decomp_update.pyx":973
23782 : * # qr
23783 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
23784 : * if info < 0: # <<<<<<<<<<<<<<
23785 : * libc.stdlib.free(work)
23786 : * return libc.stdlib.abs(info)
23787 : */
23788 : }
23789 :
23790 : /* "scipy/linalg/_decomp_update.pyx":978
23791 : *
23792 : * # apply the Q from this small qr to the last (m-n) columns of q.
23793 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
23794 : * index2(q, qs, 0, n), m, work, lwork)
23795 : * if info < 0:
23796 : */
23797 43 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
23798 :
23799 : /* "scipy/linalg/_decomp_update.pyx":980
23800 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23801 : * index2(q, qs, 0, n), m, work, lwork)
23802 : * if info < 0: # <<<<<<<<<<<<<<
23803 : * libc.stdlib.free(work)
23804 : * return info
23805 : */
23806 43 : __pyx_t_1 = (__pyx_v_info < 0);
23807 43 : if (__pyx_t_1) {
23808 :
23809 : /* "scipy/linalg/_decomp_update.pyx":981
23810 : * index2(q, qs, 0, n), m, work, lwork)
23811 : * if info < 0:
23812 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
23813 : * return info
23814 : *
23815 : */
23816 0 : free(__pyx_v_work);
23817 :
23818 : /* "scipy/linalg/_decomp_update.pyx":982
23819 : * if info < 0:
23820 : * libc.stdlib.free(work)
23821 : * return info # <<<<<<<<<<<<<<
23822 : *
23823 : * # reduce u the rest of the way to upper triangular using givens.
23824 : */
23825 0 : __pyx_r = __pyx_v_info;
23826 0 : goto __pyx_L0;
23827 :
23828 : /* "scipy/linalg/_decomp_update.pyx":980
23829 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
23830 : * index2(q, qs, 0, n), m, work, lwork)
23831 : * if info < 0: # <<<<<<<<<<<<<<
23832 : * libc.stdlib.free(work)
23833 : * return info
23834 : */
23835 : }
23836 :
23837 : /* "scipy/linalg/_decomp_update.pyx":985
23838 : *
23839 : * # reduce u the rest of the way to upper triangular using givens.
23840 : * for i in range(p): # <<<<<<<<<<<<<<
23841 : * for j in range(n+i-1, i-1, -1):
23842 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23843 : */
23844 173 : __pyx_t_4 = __pyx_v_p;
23845 173 : __pyx_t_2 = __pyx_t_4;
23846 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23847 130 : __pyx_v_i = __pyx_t_3;
23848 :
23849 : /* "scipy/linalg/_decomp_update.pyx":986
23850 : * # reduce u the rest of the way to upper triangular using givens.
23851 : * for i in range(p):
23852 : * for j in range(n+i-1, i-1, -1): # <<<<<<<<<<<<<<
23853 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23854 : * if p-i-1:
23855 : */
23856 130 : __pyx_t_5 = (__pyx_v_i - 1);
23857 130 : __pyx_t_6 = __pyx_t_5;
23858 1040 : for (__pyx_t_7 = ((__pyx_v_n + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
23859 910 : __pyx_v_j = __pyx_t_7;
23860 :
23861 : /* "scipy/linalg/_decomp_update.pyx":987
23862 : * for i in range(p):
23863 : * for j in range(n+i-1, i-1, -1):
23864 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
23865 : * if p-i-1:
23866 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23867 : */
23868 910 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
23869 :
23870 : /* "scipy/linalg/_decomp_update.pyx":988
23871 : * for j in range(n+i-1, i-1, -1):
23872 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23873 : * if p-i-1: # <<<<<<<<<<<<<<
23874 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23875 : * index2(u, us, j+1, i+1), us[1], c, s)
23876 : */
23877 910 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
23878 910 : if (__pyx_t_1) {
23879 :
23880 : /* "scipy/linalg/_decomp_update.pyx":989
23881 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23882 : * if p-i-1:
23883 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
23884 : * index2(u, us, j+1, i+1), us[1], c, s)
23885 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
23886 : */
23887 609 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
23888 :
23889 : /* "scipy/linalg/_decomp_update.pyx":988
23890 : * for j in range(n+i-1, i-1, -1):
23891 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23892 : * if p-i-1: # <<<<<<<<<<<<<<
23893 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23894 : * index2(u, us, j+1, i+1), us[1], c, s)
23895 : */
23896 : }
23897 :
23898 : /* "scipy/linalg/_decomp_update.pyx":991
23899 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23900 : * index2(u, us, j+1, i+1), us[1], c, s)
23901 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
23902 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
23903 : * c, s.conjugate())
23904 : */
23905 910 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
23906 :
23907 : /* "scipy/linalg/_decomp_update.pyx":992
23908 : * index2(u, us, j+1, i+1), us[1], c, s)
23909 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
23910 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
23911 : * c, s.conjugate())
23912 : *
23913 : */
23914 910 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
23915 : }
23916 : }
23917 :
23918 : /* "scipy/linalg/_decomp_update.pyx":948
23919 : * cdef char* diag = 'N'
23920 : *
23921 : * if m > n: # <<<<<<<<<<<<<<
23922 : * # query the workspace
23923 : * # below p_subdiag_qr will need workspace of size m, which is the
23924 : */
23925 43 : goto __pyx_L3;
23926 : }
23927 :
23928 : /* "scipy/linalg/_decomp_update.pyx":997
23929 : * else: # m == n or m < n
23930 : * # reduce u to upper triangular using givens.
23931 : * for i in range(p): # <<<<<<<<<<<<<<
23932 : * for j in range(m-2, i-1, -1):
23933 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23934 : */
23935 : /*else*/ {
23936 674 : __pyx_t_4 = __pyx_v_p;
23937 674 : __pyx_t_2 = __pyx_t_4;
23938 674 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23939 506 : __pyx_v_i = __pyx_t_3;
23940 :
23941 : /* "scipy/linalg/_decomp_update.pyx":998
23942 : * # reduce u to upper triangular using givens.
23943 : * for i in range(p):
23944 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
23945 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23946 : * if p-i-1:
23947 : */
23948 506 : __pyx_t_5 = (__pyx_v_i - 1);
23949 506 : __pyx_t_6 = __pyx_t_5;
23950 3284 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
23951 2778 : __pyx_v_j = __pyx_t_7;
23952 :
23953 : /* "scipy/linalg/_decomp_update.pyx":999
23954 : * for i in range(p):
23955 : * for j in range(m-2, i-1, -1):
23956 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
23957 : * if p-i-1:
23958 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23959 : */
23960 2778 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
23961 :
23962 : /* "scipy/linalg/_decomp_update.pyx":1000
23963 : * for j in range(m-2, i-1, -1):
23964 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23965 : * if p-i-1: # <<<<<<<<<<<<<<
23966 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23967 : * index2(u, us, j+1, i+1), us[1], c, s)
23968 : */
23969 2778 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
23970 2778 : if (__pyx_t_1) {
23971 :
23972 : /* "scipy/linalg/_decomp_update.pyx":1001
23973 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23974 : * if p-i-1:
23975 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
23976 : * index2(u, us, j+1, i+1), us[1], c, s)
23977 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
23978 : */
23979 2023 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
23980 :
23981 : /* "scipy/linalg/_decomp_update.pyx":1000
23982 : * for j in range(m-2, i-1, -1):
23983 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
23984 : * if p-i-1: # <<<<<<<<<<<<<<
23985 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23986 : * index2(u, us, j+1, i+1), us[1], c, s)
23987 : */
23988 : }
23989 :
23990 : /* "scipy/linalg/_decomp_update.pyx":1003
23991 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
23992 : * index2(u, us, j+1, i+1), us[1], c, s)
23993 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
23994 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
23995 : * c, s.conjugate())
23996 : */
23997 2778 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
23998 :
23999 : /* "scipy/linalg/_decomp_update.pyx":1004
24000 : * index2(u, us, j+1, i+1), us[1], c, s)
24001 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
24002 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
24003 : * c, s.conjugate())
24004 : *
24005 : */
24006 2778 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
24007 : }
24008 : }
24009 :
24010 : /* "scipy/linalg/_decomp_update.pyx":1008
24011 : *
24012 : * # allocate workspace
24013 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t)) # <<<<<<<<<<<<<<
24014 : * if not work:
24015 : * return MEMORY_ERROR
24016 : */
24017 168 : __pyx_v_work = ((__pyx_t_float_complex *)malloc((__pyx_v_n * (sizeof(__pyx_t_float_complex)))));
24018 :
24019 : /* "scipy/linalg/_decomp_update.pyx":1009
24020 : * # allocate workspace
24021 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
24022 : * if not work: # <<<<<<<<<<<<<<
24023 : * return MEMORY_ERROR
24024 : *
24025 : */
24026 168 : __pyx_t_1 = (!(__pyx_v_work != 0));
24027 168 : if (__pyx_t_1) {
24028 :
24029 : /* "scipy/linalg/_decomp_update.pyx":1010
24030 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
24031 : * if not work:
24032 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
24033 : *
24034 : * # now form UV**H and add it to R.
24035 : */
24036 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
24037 0 : goto __pyx_L0;
24038 :
24039 : /* "scipy/linalg/_decomp_update.pyx":1009
24040 : * # allocate workspace
24041 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
24042 : * if not work: # <<<<<<<<<<<<<<
24043 : * return MEMORY_ERROR
24044 : *
24045 : */
24046 : }
24047 : }
24048 168 : __pyx_L3:;
24049 :
24050 : /* "scipy/linalg/_decomp_update.pyx":1014
24051 : * # now form UV**H and add it to R.
24052 : * # This won't fill in any more of R than we have already.
24053 : * blas_t_2d_conj(p, n, v, vs) # <<<<<<<<<<<<<<
24054 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p)
24055 : *
24056 : */
24057 211 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_p, __pyx_v_n, __pyx_v_v, __pyx_v_vs);
24058 :
24059 : /* "scipy/linalg/_decomp_update.pyx":1015
24060 : * # This won't fill in any more of R than we have already.
24061 : * blas_t_2d_conj(p, n, v, vs)
24062 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p) # <<<<<<<<<<<<<<
24063 : *
24064 : * # (should this be n, p length adds instead since these are fortran contig?)
24065 : */
24066 422 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_trmm(__pyx_v_sideL, __pyx_v_uplo, __pyx_v_trans, __pyx_v_diag, __pyx_v_p, __pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, __pyx_v_m, __pyx_v_v, __pyx_v_p);
24067 :
24068 : /* "scipy/linalg/_decomp_update.pyx":1018
24069 : *
24070 : * # (should this be n, p length adds instead since these are fortran contig?)
24071 : * for j in range(p): # <<<<<<<<<<<<<<
24072 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1])
24073 : *
24074 : */
24075 211 : __pyx_t_4 = __pyx_v_p;
24076 211 : __pyx_t_2 = __pyx_t_4;
24077 847 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24078 636 : __pyx_v_j = __pyx_t_3;
24079 :
24080 : /* "scipy/linalg/_decomp_update.pyx":1019
24081 : * # (should this be n, p length adds instead since these are fortran contig?)
24082 : * for j in range(p):
24083 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1]) # <<<<<<<<<<<<<<
24084 : *
24085 : * # now r has p subdiagonals, eliminate them with reflectors.
24086 : */
24087 636 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_v, __pyx_v_vs, __pyx_v_j), (__pyx_v_vs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]));
24088 : }
24089 :
24090 : /* "scipy/linalg/_decomp_update.pyx":1022
24091 : *
24092 : * # now r has p subdiagonals, eliminate them with reflectors.
24093 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work) # <<<<<<<<<<<<<<
24094 : *
24095 : * libc.stdlib.free(work)
24096 : */
24097 211 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0, __pyx_v_p, __pyx_v_work);
24098 :
24099 : /* "scipy/linalg/_decomp_update.pyx":1024
24100 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work)
24101 : *
24102 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
24103 : * return 0
24104 : *
24105 : */
24106 211 : free(__pyx_v_work);
24107 :
24108 : /* "scipy/linalg/_decomp_update.pyx":1025
24109 : *
24110 : * libc.stdlib.free(work)
24111 : * return 0 # <<<<<<<<<<<<<<
24112 : *
24113 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
24114 : */
24115 211 : __pyx_r = 0;
24116 211 : goto __pyx_L0;
24117 :
24118 : /* "scipy/linalg/_decomp_update.pyx":935
24119 : * # no return, return q, r from python driver.
24120 : *
24121 : * cdef int qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
24122 : * int* rs, blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
24123 : * cdef int i, j
24124 : */
24125 :
24126 : /* function exit code */
24127 211 : __pyx_L0:;
24128 211 : return __pyx_r;
24129 : }
24130 :
24131 211 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(int __pyx_v_m, int __pyx_v_n, int __pyx_v_p, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_double_complex *__pyx_v_v, int *__pyx_v_vs) {
24132 211 : int __pyx_v_i;
24133 211 : int __pyx_v_j;
24134 211 : __pyx_t_double_complex __pyx_v_c;
24135 211 : __pyx_t_double_complex __pyx_v_s;
24136 211 : __pyx_t_double_complex *__pyx_v_tau;
24137 211 : __pyx_t_double_complex *__pyx_v_work;
24138 211 : int __pyx_v_info;
24139 211 : int __pyx_v_lwork;
24140 211 : char *__pyx_v_sideR;
24141 211 : char *__pyx_v_sideL;
24142 211 : char *__pyx_v_uplo;
24143 211 : char *__pyx_v_trans;
24144 211 : char *__pyx_v_diag;
24145 211 : int __pyx_r;
24146 211 : int __pyx_t_1;
24147 211 : int __pyx_t_2;
24148 211 : int __pyx_t_3;
24149 211 : int __pyx_t_4;
24150 211 : long __pyx_t_5;
24151 211 : long __pyx_t_6;
24152 211 : int __pyx_t_7;
24153 :
24154 : /* "scipy/linalg/_decomp_update.pyx":939
24155 : * cdef int i, j
24156 : * cdef blas_t c, s
24157 : * cdef blas_t* tau = NULL # <<<<<<<<<<<<<<
24158 : * cdef blas_t* work = NULL
24159 : * cdef int info, lwork
24160 : */
24161 211 : __pyx_v_tau = NULL;
24162 :
24163 : /* "scipy/linalg/_decomp_update.pyx":940
24164 : * cdef blas_t c, s
24165 : * cdef blas_t* tau = NULL
24166 : * cdef blas_t* work = NULL # <<<<<<<<<<<<<<
24167 : * cdef int info, lwork
24168 : * cdef char* sideR = 'R'
24169 : */
24170 211 : __pyx_v_work = NULL;
24171 :
24172 : /* "scipy/linalg/_decomp_update.pyx":942
24173 : * cdef blas_t* work = NULL
24174 : * cdef int info, lwork
24175 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
24176 : * cdef char* sideL = 'L'
24177 : * cdef char* uplo = 'U'
24178 : */
24179 211 : __pyx_v_sideR = ((char *)"R");
24180 :
24181 : /* "scipy/linalg/_decomp_update.pyx":943
24182 : * cdef int info, lwork
24183 : * cdef char* sideR = 'R'
24184 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
24185 : * cdef char* uplo = 'U'
24186 : * cdef char* trans = 'N'
24187 : */
24188 211 : __pyx_v_sideL = ((char *)"L");
24189 :
24190 : /* "scipy/linalg/_decomp_update.pyx":944
24191 : * cdef char* sideR = 'R'
24192 : * cdef char* sideL = 'L'
24193 : * cdef char* uplo = 'U' # <<<<<<<<<<<<<<
24194 : * cdef char* trans = 'N'
24195 : * cdef char* diag = 'N'
24196 : */
24197 211 : __pyx_v_uplo = ((char *)"U");
24198 :
24199 : /* "scipy/linalg/_decomp_update.pyx":945
24200 : * cdef char* sideL = 'L'
24201 : * cdef char* uplo = 'U'
24202 : * cdef char* trans = 'N' # <<<<<<<<<<<<<<
24203 : * cdef char* diag = 'N'
24204 : *
24205 : */
24206 211 : __pyx_v_trans = ((char *)"N");
24207 :
24208 : /* "scipy/linalg/_decomp_update.pyx":946
24209 : * cdef char* uplo = 'U'
24210 : * cdef char* trans = 'N'
24211 : * cdef char* diag = 'N' # <<<<<<<<<<<<<<
24212 : *
24213 : * if m > n:
24214 : */
24215 211 : __pyx_v_diag = ((char *)"N");
24216 :
24217 : /* "scipy/linalg/_decomp_update.pyx":948
24218 : * cdef char* diag = 'N'
24219 : *
24220 : * if m > n: # <<<<<<<<<<<<<<
24221 : * # query the workspace
24222 : * # below p_subdiag_qr will need workspace of size m, which is the
24223 : */
24224 211 : __pyx_t_1 = (__pyx_v_m > __pyx_v_n);
24225 211 : if (__pyx_t_1) {
24226 :
24227 : /* "scipy/linalg/_decomp_update.pyx":953
24228 : * # minimum, ormqr will also require.
24229 : * # set tau to point at something, to keep new MKL working.
24230 : * tau = &c # <<<<<<<<<<<<<<
24231 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
24232 : * if info < 0:
24233 : */
24234 43 : __pyx_v_tau = (&__pyx_v_c);
24235 :
24236 : /* "scipy/linalg/_decomp_update.pyx":954
24237 : * # set tau to point at something, to keep new MKL working.
24238 : * tau = &c
24239 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1) # <<<<<<<<<<<<<<
24240 : * if info < 0:
24241 : * return libc.stdlib.abs(info)
24242 : */
24243 43 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, (&__pyx_v_c), -1);
24244 :
24245 : /* "scipy/linalg/_decomp_update.pyx":955
24246 : * tau = &c
24247 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
24248 : * if info < 0: # <<<<<<<<<<<<<<
24249 : * return libc.stdlib.abs(info)
24250 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
24251 : */
24252 43 : __pyx_t_1 = (__pyx_v_info < 0);
24253 43 : if (__pyx_t_1) {
24254 :
24255 : /* "scipy/linalg/_decomp_update.pyx":956
24256 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
24257 : * if info < 0:
24258 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
24259 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
24260 : * index2(q, qs, 0, n), m, &s, -1)
24261 : */
24262 0 : __pyx_r = abs(__pyx_v_info);
24263 0 : goto __pyx_L0;
24264 :
24265 : /* "scipy/linalg/_decomp_update.pyx":955
24266 : * tau = &c
24267 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, &c, -1)
24268 : * if info < 0: # <<<<<<<<<<<<<<
24269 : * return libc.stdlib.abs(info)
24270 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
24271 : */
24272 : }
24273 :
24274 : /* "scipy/linalg/_decomp_update.pyx":957
24275 : * if info < 0:
24276 : * return libc.stdlib.abs(info)
24277 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
24278 : * index2(q, qs, 0, n), m, &s, -1)
24279 : * if info < 0:
24280 : */
24281 43 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, (&__pyx_v_s), -1);
24282 :
24283 : /* "scipy/linalg/_decomp_update.pyx":959
24284 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
24285 : * index2(q, qs, 0, n), m, &s, -1)
24286 : * if info < 0: # <<<<<<<<<<<<<<
24287 : * return info
24288 : *
24289 : */
24290 43 : __pyx_t_1 = (__pyx_v_info < 0);
24291 43 : if (__pyx_t_1) {
24292 :
24293 : /* "scipy/linalg/_decomp_update.pyx":960
24294 : * index2(q, qs, 0, n), m, &s, -1)
24295 : * if info < 0:
24296 : * return info # <<<<<<<<<<<<<<
24297 : *
24298 : * # we're only doing one allocation, so use the larger
24299 : */
24300 0 : __pyx_r = __pyx_v_info;
24301 0 : goto __pyx_L0;
24302 :
24303 : /* "scipy/linalg/_decomp_update.pyx":959
24304 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
24305 : * index2(q, qs, 0, n), m, &s, -1)
24306 : * if info < 0: # <<<<<<<<<<<<<<
24307 : * return info
24308 : *
24309 : */
24310 : }
24311 :
24312 : /* "scipy/linalg/_decomp_update.pyx":963
24313 : *
24314 : * # we're only doing one allocation, so use the larger
24315 : * lwork = to_lwork(c, s) # <<<<<<<<<<<<<<
24316 : *
24317 : * # allocate the workspace + tau
24318 : */
24319 43 : __pyx_v_lwork = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_to_lwork(__pyx_v_c, __pyx_v_s);
24320 :
24321 : /* "scipy/linalg/_decomp_update.pyx":966
24322 : *
24323 : * # allocate the workspace + tau
24324 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t)) # <<<<<<<<<<<<<<
24325 : * if not work:
24326 : * return MEMORY_ERROR
24327 : */
24328 43 : __pyx_t_2 = __pyx_v_p;
24329 43 : __pyx_t_3 = (__pyx_v_m - __pyx_v_n);
24330 43 : __pyx_t_1 = (__pyx_t_2 < __pyx_t_3);
24331 43 : if (__pyx_t_1) {
24332 : __pyx_t_4 = __pyx_t_2;
24333 : } else {
24334 : __pyx_t_4 = __pyx_t_3;
24335 : }
24336 43 : __pyx_v_work = ((__pyx_t_double_complex *)malloc(((__pyx_v_lwork + __pyx_t_4) * (sizeof(__pyx_t_double_complex)))));
24337 :
24338 : /* "scipy/linalg/_decomp_update.pyx":967
24339 : * # allocate the workspace + tau
24340 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
24341 : * if not work: # <<<<<<<<<<<<<<
24342 : * return MEMORY_ERROR
24343 : * tau = work + lwork
24344 : */
24345 43 : __pyx_t_1 = (!(__pyx_v_work != 0));
24346 43 : if (__pyx_t_1) {
24347 :
24348 : /* "scipy/linalg/_decomp_update.pyx":968
24349 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
24350 : * if not work:
24351 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
24352 : * tau = work + lwork
24353 : *
24354 : */
24355 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
24356 0 : goto __pyx_L0;
24357 :
24358 : /* "scipy/linalg/_decomp_update.pyx":967
24359 : * # allocate the workspace + tau
24360 : * work = <blas_t*>libc.stdlib.malloc((lwork+min(m-n, p))*sizeof(blas_t))
24361 : * if not work: # <<<<<<<<<<<<<<
24362 : * return MEMORY_ERROR
24363 : * tau = work + lwork
24364 : */
24365 : }
24366 :
24367 : /* "scipy/linalg/_decomp_update.pyx":969
24368 : * if not work:
24369 : * return MEMORY_ERROR
24370 : * tau = work + lwork # <<<<<<<<<<<<<<
24371 : *
24372 : * # qr
24373 : */
24374 43 : __pyx_v_tau = (__pyx_v_work + __pyx_v_lwork);
24375 :
24376 : /* "scipy/linalg/_decomp_update.pyx":972
24377 : *
24378 : * # qr
24379 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork) # <<<<<<<<<<<<<<
24380 : * if info < 0:
24381 : * libc.stdlib.free(work)
24382 : */
24383 43 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_geqrf((__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_v_work, __pyx_v_lwork);
24384 :
24385 : /* "scipy/linalg/_decomp_update.pyx":973
24386 : * # qr
24387 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
24388 : * if info < 0: # <<<<<<<<<<<<<<
24389 : * libc.stdlib.free(work)
24390 : * return libc.stdlib.abs(info)
24391 : */
24392 43 : __pyx_t_1 = (__pyx_v_info < 0);
24393 43 : if (__pyx_t_1) {
24394 :
24395 : /* "scipy/linalg/_decomp_update.pyx":974
24396 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
24397 : * if info < 0:
24398 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
24399 : * return libc.stdlib.abs(info)
24400 : *
24401 : */
24402 0 : free(__pyx_v_work);
24403 :
24404 : /* "scipy/linalg/_decomp_update.pyx":975
24405 : * if info < 0:
24406 : * libc.stdlib.free(work)
24407 : * return libc.stdlib.abs(info) # <<<<<<<<<<<<<<
24408 : *
24409 : * # apply the Q from this small qr to the last (m-n) columns of q.
24410 : */
24411 0 : __pyx_r = abs(__pyx_v_info);
24412 0 : goto __pyx_L0;
24413 :
24414 : /* "scipy/linalg/_decomp_update.pyx":973
24415 : * # qr
24416 : * info = geqrf(m-n, p, index2(u, us, n, 0), m, tau, work, lwork)
24417 : * if info < 0: # <<<<<<<<<<<<<<
24418 : * libc.stdlib.free(work)
24419 : * return libc.stdlib.abs(info)
24420 : */
24421 : }
24422 :
24423 : /* "scipy/linalg/_decomp_update.pyx":978
24424 : *
24425 : * # apply the Q from this small qr to the last (m-n) columns of q.
24426 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau, # <<<<<<<<<<<<<<
24427 : * index2(q, qs, 0, n), m, work, lwork)
24428 : * if info < 0:
24429 : */
24430 43 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_ormqr(__pyx_v_sideR, __pyx_v_trans, __pyx_v_m, (__pyx_v_m - __pyx_v_n), __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_n, 0), __pyx_v_m, __pyx_v_tau, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_n), __pyx_v_m, __pyx_v_work, __pyx_v_lwork);
24431 :
24432 : /* "scipy/linalg/_decomp_update.pyx":980
24433 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
24434 : * index2(q, qs, 0, n), m, work, lwork)
24435 : * if info < 0: # <<<<<<<<<<<<<<
24436 : * libc.stdlib.free(work)
24437 : * return info
24438 : */
24439 43 : __pyx_t_1 = (__pyx_v_info < 0);
24440 43 : if (__pyx_t_1) {
24441 :
24442 : /* "scipy/linalg/_decomp_update.pyx":981
24443 : * index2(q, qs, 0, n), m, work, lwork)
24444 : * if info < 0:
24445 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
24446 : * return info
24447 : *
24448 : */
24449 0 : free(__pyx_v_work);
24450 :
24451 : /* "scipy/linalg/_decomp_update.pyx":982
24452 : * if info < 0:
24453 : * libc.stdlib.free(work)
24454 : * return info # <<<<<<<<<<<<<<
24455 : *
24456 : * # reduce u the rest of the way to upper triangular using givens.
24457 : */
24458 0 : __pyx_r = __pyx_v_info;
24459 0 : goto __pyx_L0;
24460 :
24461 : /* "scipy/linalg/_decomp_update.pyx":980
24462 : * info = ormqr(sideR, trans, m, m-n, p, index2(u, us, n, 0), m, tau,
24463 : * index2(q, qs, 0, n), m, work, lwork)
24464 : * if info < 0: # <<<<<<<<<<<<<<
24465 : * libc.stdlib.free(work)
24466 : * return info
24467 : */
24468 : }
24469 :
24470 : /* "scipy/linalg/_decomp_update.pyx":985
24471 : *
24472 : * # reduce u the rest of the way to upper triangular using givens.
24473 : * for i in range(p): # <<<<<<<<<<<<<<
24474 : * for j in range(n+i-1, i-1, -1):
24475 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24476 : */
24477 173 : __pyx_t_4 = __pyx_v_p;
24478 173 : __pyx_t_2 = __pyx_t_4;
24479 173 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24480 130 : __pyx_v_i = __pyx_t_3;
24481 :
24482 : /* "scipy/linalg/_decomp_update.pyx":986
24483 : * # reduce u the rest of the way to upper triangular using givens.
24484 : * for i in range(p):
24485 : * for j in range(n+i-1, i-1, -1): # <<<<<<<<<<<<<<
24486 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24487 : * if p-i-1:
24488 : */
24489 130 : __pyx_t_5 = (__pyx_v_i - 1);
24490 130 : __pyx_t_6 = __pyx_t_5;
24491 1040 : for (__pyx_t_7 = ((__pyx_v_n + __pyx_v_i) - 1); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
24492 910 : __pyx_v_j = __pyx_t_7;
24493 :
24494 : /* "scipy/linalg/_decomp_update.pyx":987
24495 : * for i in range(p):
24496 : * for j in range(n+i-1, i-1, -1):
24497 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
24498 : * if p-i-1:
24499 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24500 : */
24501 910 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
24502 :
24503 : /* "scipy/linalg/_decomp_update.pyx":988
24504 : * for j in range(n+i-1, i-1, -1):
24505 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24506 : * if p-i-1: # <<<<<<<<<<<<<<
24507 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24508 : * index2(u, us, j+1, i+1), us[1], c, s)
24509 : */
24510 910 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
24511 910 : if (__pyx_t_1) {
24512 :
24513 : /* "scipy/linalg/_decomp_update.pyx":989
24514 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24515 : * if p-i-1:
24516 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
24517 : * index2(u, us, j+1, i+1), us[1], c, s)
24518 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
24519 : */
24520 609 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
24521 :
24522 : /* "scipy/linalg/_decomp_update.pyx":988
24523 : * for j in range(n+i-1, i-1, -1):
24524 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24525 : * if p-i-1: # <<<<<<<<<<<<<<
24526 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24527 : * index2(u, us, j+1, i+1), us[1], c, s)
24528 : */
24529 : }
24530 :
24531 : /* "scipy/linalg/_decomp_update.pyx":991
24532 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24533 : * index2(u, us, j+1, i+1), us[1], c, s)
24534 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
24535 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
24536 : * c, s.conjugate())
24537 : */
24538 910 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
24539 :
24540 : /* "scipy/linalg/_decomp_update.pyx":992
24541 : * index2(u, us, j+1, i+1), us[1], c, s)
24542 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
24543 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
24544 : * c, s.conjugate())
24545 : *
24546 : */
24547 910 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
24548 : }
24549 : }
24550 :
24551 : /* "scipy/linalg/_decomp_update.pyx":948
24552 : * cdef char* diag = 'N'
24553 : *
24554 : * if m > n: # <<<<<<<<<<<<<<
24555 : * # query the workspace
24556 : * # below p_subdiag_qr will need workspace of size m, which is the
24557 : */
24558 43 : goto __pyx_L3;
24559 : }
24560 :
24561 : /* "scipy/linalg/_decomp_update.pyx":997
24562 : * else: # m == n or m < n
24563 : * # reduce u to upper triangular using givens.
24564 : * for i in range(p): # <<<<<<<<<<<<<<
24565 : * for j in range(m-2, i-1, -1):
24566 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24567 : */
24568 : /*else*/ {
24569 674 : __pyx_t_4 = __pyx_v_p;
24570 674 : __pyx_t_2 = __pyx_t_4;
24571 674 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24572 506 : __pyx_v_i = __pyx_t_3;
24573 :
24574 : /* "scipy/linalg/_decomp_update.pyx":998
24575 : * # reduce u to upper triangular using givens.
24576 : * for i in range(p):
24577 : * for j in range(m-2, i-1, -1): # <<<<<<<<<<<<<<
24578 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24579 : * if p-i-1:
24580 : */
24581 506 : __pyx_t_5 = (__pyx_v_i - 1);
24582 506 : __pyx_t_6 = __pyx_t_5;
24583 3284 : for (__pyx_t_7 = (__pyx_v_m - 2); __pyx_t_7 > __pyx_t_6; __pyx_t_7-=1) {
24584 2778 : __pyx_v_j = __pyx_t_7;
24585 :
24586 : /* "scipy/linalg/_decomp_update.pyx":999
24587 : * for i in range(p):
24588 : * for j in range(m-2, i-1, -1):
24589 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s) # <<<<<<<<<<<<<<
24590 : * if p-i-1:
24591 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24592 : */
24593 2778 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, __pyx_v_i), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), __pyx_v_i), (&__pyx_v_c), (&__pyx_v_s));
24594 :
24595 : /* "scipy/linalg/_decomp_update.pyx":1000
24596 : * for j in range(m-2, i-1, -1):
24597 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24598 : * if p-i-1: # <<<<<<<<<<<<<<
24599 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24600 : * index2(u, us, j+1, i+1), us[1], c, s)
24601 : */
24602 2778 : __pyx_t_1 = (((__pyx_v_p - __pyx_v_i) - 1) != 0);
24603 2778 : if (__pyx_t_1) {
24604 :
24605 : /* "scipy/linalg/_decomp_update.pyx":1001
24606 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24607 : * if p-i-1:
24608 : * rot(p-i-1, index2(u, us, j, i+1), us[1], # <<<<<<<<<<<<<<
24609 : * index2(u, us, j+1, i+1), us[1], c, s)
24610 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
24611 : */
24612 2023 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_p - __pyx_v_i) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, __pyx_v_j, (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_u, __pyx_v_us, (__pyx_v_j + 1), (__pyx_v_i + 1)), (__pyx_v_us[1]), __pyx_v_c, __pyx_v_s);
24613 :
24614 : /* "scipy/linalg/_decomp_update.pyx":1000
24615 : * for j in range(m-2, i-1, -1):
24616 : * lartg(index2(u, us, j, i), index2(u, us, j+1, i), &c, &s)
24617 : * if p-i-1: # <<<<<<<<<<<<<<
24618 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24619 : * index2(u, us, j+1, i+1), us[1], c, s)
24620 : */
24621 : }
24622 :
24623 : /* "scipy/linalg/_decomp_update.pyx":1003
24624 : * rot(p-i-1, index2(u, us, j, i+1), us[1],
24625 : * index2(u, us, j+1, i+1), us[1], c, s)
24626 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s) # <<<<<<<<<<<<<<
24627 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0],
24628 : * c, s.conjugate())
24629 : */
24630 2778 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_n, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
24631 :
24632 : /* "scipy/linalg/_decomp_update.pyx":1004
24633 : * index2(u, us, j+1, i+1), us[1], c, s)
24634 : * rot(n, row(r, rs, j), rs[1], row(r, rs, j+1), rs[1], c, s)
24635 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], # <<<<<<<<<<<<<<
24636 : * c, s.conjugate())
24637 : *
24638 : */
24639 2778 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
24640 : }
24641 : }
24642 :
24643 : /* "scipy/linalg/_decomp_update.pyx":1008
24644 : *
24645 : * # allocate workspace
24646 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t)) # <<<<<<<<<<<<<<
24647 : * if not work:
24648 : * return MEMORY_ERROR
24649 : */
24650 168 : __pyx_v_work = ((__pyx_t_double_complex *)malloc((__pyx_v_n * (sizeof(__pyx_t_double_complex)))));
24651 :
24652 : /* "scipy/linalg/_decomp_update.pyx":1009
24653 : * # allocate workspace
24654 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
24655 : * if not work: # <<<<<<<<<<<<<<
24656 : * return MEMORY_ERROR
24657 : *
24658 : */
24659 168 : __pyx_t_1 = (!(__pyx_v_work != 0));
24660 168 : if (__pyx_t_1) {
24661 :
24662 : /* "scipy/linalg/_decomp_update.pyx":1010
24663 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
24664 : * if not work:
24665 : * return MEMORY_ERROR # <<<<<<<<<<<<<<
24666 : *
24667 : * # now form UV**H and add it to R.
24668 : */
24669 0 : __pyx_r = __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR;
24670 0 : goto __pyx_L0;
24671 :
24672 : /* "scipy/linalg/_decomp_update.pyx":1009
24673 : * # allocate workspace
24674 : * work = <blas_t*>libc.stdlib.malloc(n*sizeof(blas_t))
24675 : * if not work: # <<<<<<<<<<<<<<
24676 : * return MEMORY_ERROR
24677 : *
24678 : */
24679 : }
24680 : }
24681 168 : __pyx_L3:;
24682 :
24683 : /* "scipy/linalg/_decomp_update.pyx":1014
24684 : * # now form UV**H and add it to R.
24685 : * # This won't fill in any more of R than we have already.
24686 : * blas_t_2d_conj(p, n, v, vs) # <<<<<<<<<<<<<<
24687 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p)
24688 : *
24689 : */
24690 211 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_p, __pyx_v_n, __pyx_v_v, __pyx_v_vs);
24691 :
24692 : /* "scipy/linalg/_decomp_update.pyx":1015
24693 : * # This won't fill in any more of R than we have already.
24694 : * blas_t_2d_conj(p, n, v, vs)
24695 : * trmm(sideL, uplo, trans, diag, p, n, 1, u, m, v, p) # <<<<<<<<<<<<<<
24696 : *
24697 : * # (should this be n, p length adds instead since these are fortran contig?)
24698 : */
24699 422 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_trmm(__pyx_v_sideL, __pyx_v_uplo, __pyx_v_trans, __pyx_v_diag, __pyx_v_p, __pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, __pyx_v_m, __pyx_v_v, __pyx_v_p);
24700 :
24701 : /* "scipy/linalg/_decomp_update.pyx":1018
24702 : *
24703 : * # (should this be n, p length adds instead since these are fortran contig?)
24704 : * for j in range(p): # <<<<<<<<<<<<<<
24705 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1])
24706 : *
24707 : */
24708 211 : __pyx_t_4 = __pyx_v_p;
24709 211 : __pyx_t_2 = __pyx_t_4;
24710 847 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24711 636 : __pyx_v_j = __pyx_t_3;
24712 :
24713 : /* "scipy/linalg/_decomp_update.pyx":1019
24714 : * # (should this be n, p length adds instead since these are fortran contig?)
24715 : * for j in range(p):
24716 : * axpy(n, 1, row(v, vs, j), vs[1], row(r, rs, j), rs[1]) # <<<<<<<<<<<<<<
24717 : *
24718 : * # now r has p subdiagonals, eliminate them with reflectors.
24719 : */
24720 636 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_v, __pyx_v_vs, __pyx_v_j), (__pyx_v_vs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_row(__pyx_v_r, __pyx_v_rs, __pyx_v_j), (__pyx_v_rs[1]));
24721 : }
24722 :
24723 : /* "scipy/linalg/_decomp_update.pyx":1022
24724 : *
24725 : * # now r has p subdiagonals, eliminate them with reflectors.
24726 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work) # <<<<<<<<<<<<<<
24727 : *
24728 : * libc.stdlib.free(work)
24729 : */
24730 211 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(__pyx_v_m, __pyx_v_m, __pyx_v_n, __pyx_v_q, __pyx_v_qs, __pyx_v_r, __pyx_v_rs, 0, __pyx_v_p, __pyx_v_work);
24731 :
24732 : /* "scipy/linalg/_decomp_update.pyx":1024
24733 : * p_subdiag_qr(m, m, n, q, qs, r, rs, 0, p, work)
24734 : *
24735 : * libc.stdlib.free(work) # <<<<<<<<<<<<<<
24736 : * return 0
24737 : *
24738 : */
24739 211 : free(__pyx_v_work);
24740 :
24741 : /* "scipy/linalg/_decomp_update.pyx":1025
24742 : *
24743 : * libc.stdlib.free(work)
24744 : * return 0 # <<<<<<<<<<<<<<
24745 : *
24746 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs,
24747 : */
24748 211 : __pyx_r = 0;
24749 211 : goto __pyx_L0;
24750 :
24751 : /* "scipy/linalg/_decomp_update.pyx":935
24752 : * # no return, return q, r from python driver.
24753 : *
24754 : * cdef int qr_rank_p_update(int m, int n, int p, blas_t* q, int* qs, blas_t* r, # <<<<<<<<<<<<<<
24755 : * int* rs, blas_t* u, int* us, blas_t* v, int* vs) noexcept nogil:
24756 : * cdef int i, j
24757 : */
24758 :
24759 : /* function exit code */
24760 211 : __pyx_L0:;
24761 211 : return __pyx_r;
24762 : }
24763 :
24764 : /* "scipy/linalg/_decomp_update.pyx":1027
24765 : * return 0
24766 : *
24767 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
24768 : * int k) noexcept nogil:
24769 : * """Reduce an upper hessenberg matrix r, to upper triangular, starting in
24770 : */
24771 :
24772 333 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
24773 333 : int __pyx_v_j;
24774 333 : float __pyx_v_c;
24775 333 : float __pyx_v_s;
24776 333 : int __pyx_v_limit;
24777 333 : int __pyx_t_1;
24778 333 : long __pyx_t_2;
24779 333 : long __pyx_t_3;
24780 333 : int __pyx_t_4;
24781 333 : int __pyx_t_5;
24782 333 : int __pyx_t_6;
24783 :
24784 : /* "scipy/linalg/_decomp_update.pyx":1035
24785 : * cdef int j
24786 : * cdef blas_t c, s
24787 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
24788 : *
24789 : * for j in range(k, limit):
24790 : */
24791 333 : __pyx_t_1 = __pyx_v_n;
24792 333 : __pyx_t_2 = (__pyx_v_m - 1);
24793 333 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
24794 333 : if (__pyx_t_4) {
24795 : __pyx_t_3 = __pyx_t_1;
24796 : } else {
24797 : __pyx_t_3 = __pyx_t_2;
24798 : }
24799 333 : __pyx_v_limit = __pyx_t_3;
24800 :
24801 : /* "scipy/linalg/_decomp_update.pyx":1037
24802 : * cdef int limit = min(m-1, n)
24803 : *
24804 : * for j in range(k, limit): # <<<<<<<<<<<<<<
24805 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s)
24806 : *
24807 : */
24808 333 : __pyx_t_1 = __pyx_v_limit;
24809 333 : __pyx_t_5 = __pyx_t_1;
24810 2283 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
24811 1950 : __pyx_v_j = __pyx_t_6;
24812 :
24813 : /* "scipy/linalg/_decomp_update.pyx":1038
24814 : *
24815 : * for j in range(k, limit):
24816 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s) # <<<<<<<<<<<<<<
24817 : *
24818 : * # update the rest of r
24819 : */
24820 1950 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
24821 :
24822 : /* "scipy/linalg/_decomp_update.pyx":1041
24823 : *
24824 : * # update the rest of r
24825 : * if j+1 < m: # <<<<<<<<<<<<<<
24826 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
24827 : * index2(r, rs, j+1, j+1), rs[1], c, s)
24828 : */
24829 1950 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_m);
24830 1950 : if (__pyx_t_4) {
24831 :
24832 : /* "scipy/linalg/_decomp_update.pyx":1042
24833 : * # update the rest of r
24834 : * if j+1 < m:
24835 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
24836 : * index2(r, rs, j+1, j+1), rs[1], c, s)
24837 : *
24838 : */
24839 1950 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
24840 :
24841 : /* "scipy/linalg/_decomp_update.pyx":1041
24842 : *
24843 : * # update the rest of r
24844 : * if j+1 < m: # <<<<<<<<<<<<<<
24845 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
24846 : * index2(r, rs, j+1, j+1), rs[1], c, s)
24847 : */
24848 : }
24849 :
24850 : /* "scipy/linalg/_decomp_update.pyx":1046
24851 : *
24852 : * # update q
24853 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
24854 : *
24855 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs,
24856 : */
24857 1950 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
24858 : }
24859 :
24860 : /* "scipy/linalg/_decomp_update.pyx":1027
24861 : * return 0
24862 : *
24863 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
24864 : * int k) noexcept nogil:
24865 : * """Reduce an upper hessenberg matrix r, to upper triangular, starting in
24866 : */
24867 :
24868 : /* function exit code */
24869 333 : }
24870 :
24871 333 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
24872 333 : int __pyx_v_j;
24873 333 : double __pyx_v_c;
24874 333 : double __pyx_v_s;
24875 333 : int __pyx_v_limit;
24876 333 : int __pyx_t_1;
24877 333 : long __pyx_t_2;
24878 333 : long __pyx_t_3;
24879 333 : int __pyx_t_4;
24880 333 : int __pyx_t_5;
24881 333 : int __pyx_t_6;
24882 :
24883 : /* "scipy/linalg/_decomp_update.pyx":1035
24884 : * cdef int j
24885 : * cdef blas_t c, s
24886 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
24887 : *
24888 : * for j in range(k, limit):
24889 : */
24890 333 : __pyx_t_1 = __pyx_v_n;
24891 333 : __pyx_t_2 = (__pyx_v_m - 1);
24892 333 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
24893 333 : if (__pyx_t_4) {
24894 : __pyx_t_3 = __pyx_t_1;
24895 : } else {
24896 : __pyx_t_3 = __pyx_t_2;
24897 : }
24898 333 : __pyx_v_limit = __pyx_t_3;
24899 :
24900 : /* "scipy/linalg/_decomp_update.pyx":1037
24901 : * cdef int limit = min(m-1, n)
24902 : *
24903 : * for j in range(k, limit): # <<<<<<<<<<<<<<
24904 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s)
24905 : *
24906 : */
24907 333 : __pyx_t_1 = __pyx_v_limit;
24908 333 : __pyx_t_5 = __pyx_t_1;
24909 2283 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
24910 1950 : __pyx_v_j = __pyx_t_6;
24911 :
24912 : /* "scipy/linalg/_decomp_update.pyx":1038
24913 : *
24914 : * for j in range(k, limit):
24915 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s) # <<<<<<<<<<<<<<
24916 : *
24917 : * # update the rest of r
24918 : */
24919 1950 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
24920 :
24921 : /* "scipy/linalg/_decomp_update.pyx":1041
24922 : *
24923 : * # update the rest of r
24924 : * if j+1 < m: # <<<<<<<<<<<<<<
24925 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
24926 : * index2(r, rs, j+1, j+1), rs[1], c, s)
24927 : */
24928 1950 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_m);
24929 1950 : if (__pyx_t_4) {
24930 :
24931 : /* "scipy/linalg/_decomp_update.pyx":1042
24932 : * # update the rest of r
24933 : * if j+1 < m:
24934 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
24935 : * index2(r, rs, j+1, j+1), rs[1], c, s)
24936 : *
24937 : */
24938 1950 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
24939 :
24940 : /* "scipy/linalg/_decomp_update.pyx":1041
24941 : *
24942 : * # update the rest of r
24943 : * if j+1 < m: # <<<<<<<<<<<<<<
24944 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
24945 : * index2(r, rs, j+1, j+1), rs[1], c, s)
24946 : */
24947 : }
24948 :
24949 : /* "scipy/linalg/_decomp_update.pyx":1046
24950 : *
24951 : * # update q
24952 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
24953 : *
24954 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs,
24955 : */
24956 1950 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, (__pyx_v_s));
24957 : }
24958 :
24959 : /* "scipy/linalg/_decomp_update.pyx":1027
24960 : * return 0
24961 : *
24962 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
24963 : * int k) noexcept nogil:
24964 : * """Reduce an upper hessenberg matrix r, to upper triangular, starting in
24965 : */
24966 :
24967 : /* function exit code */
24968 333 : }
24969 :
24970 333 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
24971 333 : int __pyx_v_j;
24972 333 : __pyx_t_float_complex __pyx_v_c;
24973 333 : __pyx_t_float_complex __pyx_v_s;
24974 333 : int __pyx_v_limit;
24975 333 : int __pyx_t_1;
24976 333 : long __pyx_t_2;
24977 333 : long __pyx_t_3;
24978 333 : int __pyx_t_4;
24979 333 : int __pyx_t_5;
24980 333 : int __pyx_t_6;
24981 :
24982 : /* "scipy/linalg/_decomp_update.pyx":1035
24983 : * cdef int j
24984 : * cdef blas_t c, s
24985 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
24986 : *
24987 : * for j in range(k, limit):
24988 : */
24989 333 : __pyx_t_1 = __pyx_v_n;
24990 333 : __pyx_t_2 = (__pyx_v_m - 1);
24991 333 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
24992 333 : if (__pyx_t_4) {
24993 : __pyx_t_3 = __pyx_t_1;
24994 : } else {
24995 : __pyx_t_3 = __pyx_t_2;
24996 : }
24997 333 : __pyx_v_limit = __pyx_t_3;
24998 :
24999 : /* "scipy/linalg/_decomp_update.pyx":1037
25000 : * cdef int limit = min(m-1, n)
25001 : *
25002 : * for j in range(k, limit): # <<<<<<<<<<<<<<
25003 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s)
25004 : *
25005 : */
25006 333 : __pyx_t_1 = __pyx_v_limit;
25007 333 : __pyx_t_5 = __pyx_t_1;
25008 2283 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25009 1950 : __pyx_v_j = __pyx_t_6;
25010 :
25011 : /* "scipy/linalg/_decomp_update.pyx":1038
25012 : *
25013 : * for j in range(k, limit):
25014 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s) # <<<<<<<<<<<<<<
25015 : *
25016 : * # update the rest of r
25017 : */
25018 1950 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
25019 :
25020 : /* "scipy/linalg/_decomp_update.pyx":1041
25021 : *
25022 : * # update the rest of r
25023 : * if j+1 < m: # <<<<<<<<<<<<<<
25024 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
25025 : * index2(r, rs, j+1, j+1), rs[1], c, s)
25026 : */
25027 1950 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_m);
25028 1950 : if (__pyx_t_4) {
25029 :
25030 : /* "scipy/linalg/_decomp_update.pyx":1042
25031 : * # update the rest of r
25032 : * if j+1 < m:
25033 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
25034 : * index2(r, rs, j+1, j+1), rs[1], c, s)
25035 : *
25036 : */
25037 1950 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
25038 :
25039 : /* "scipy/linalg/_decomp_update.pyx":1041
25040 : *
25041 : * # update the rest of r
25042 : * if j+1 < m: # <<<<<<<<<<<<<<
25043 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
25044 : * index2(r, rs, j+1, j+1), rs[1], c, s)
25045 : */
25046 : }
25047 :
25048 : /* "scipy/linalg/_decomp_update.pyx":1046
25049 : *
25050 : * # update q
25051 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
25052 : *
25053 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs,
25054 : */
25055 1950 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_float(__pyx_v_s));
25056 : }
25057 :
25058 : /* "scipy/linalg/_decomp_update.pyx":1027
25059 : * return 0
25060 : *
25061 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
25062 : * int k) noexcept nogil:
25063 : * """Reduce an upper hessenberg matrix r, to upper triangular, starting in
25064 : */
25065 :
25066 : /* function exit code */
25067 333 : }
25068 :
25069 333 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_hessenberg_qr(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k) {
25070 333 : int __pyx_v_j;
25071 333 : __pyx_t_double_complex __pyx_v_c;
25072 333 : __pyx_t_double_complex __pyx_v_s;
25073 333 : int __pyx_v_limit;
25074 333 : int __pyx_t_1;
25075 333 : long __pyx_t_2;
25076 333 : long __pyx_t_3;
25077 333 : int __pyx_t_4;
25078 333 : int __pyx_t_5;
25079 333 : int __pyx_t_6;
25080 :
25081 : /* "scipy/linalg/_decomp_update.pyx":1035
25082 : * cdef int j
25083 : * cdef blas_t c, s
25084 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
25085 : *
25086 : * for j in range(k, limit):
25087 : */
25088 333 : __pyx_t_1 = __pyx_v_n;
25089 333 : __pyx_t_2 = (__pyx_v_m - 1);
25090 333 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
25091 333 : if (__pyx_t_4) {
25092 : __pyx_t_3 = __pyx_t_1;
25093 : } else {
25094 : __pyx_t_3 = __pyx_t_2;
25095 : }
25096 333 : __pyx_v_limit = __pyx_t_3;
25097 :
25098 : /* "scipy/linalg/_decomp_update.pyx":1037
25099 : * cdef int limit = min(m-1, n)
25100 : *
25101 : * for j in range(k, limit): # <<<<<<<<<<<<<<
25102 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s)
25103 : *
25104 : */
25105 333 : __pyx_t_1 = __pyx_v_limit;
25106 333 : __pyx_t_5 = __pyx_t_1;
25107 2283 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25108 1950 : __pyx_v_j = __pyx_t_6;
25109 :
25110 : /* "scipy/linalg/_decomp_update.pyx":1038
25111 : *
25112 : * for j in range(k, limit):
25113 : * lartg(index2(r, rs, j, j), index2(r, rs, j+1, j), &c, &s) # <<<<<<<<<<<<<<
25114 : *
25115 : * # update the rest of r
25116 : */
25117 1950 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_lartg(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (&__pyx_v_c), (&__pyx_v_s));
25118 :
25119 : /* "scipy/linalg/_decomp_update.pyx":1041
25120 : *
25121 : * # update the rest of r
25122 : * if j+1 < m: # <<<<<<<<<<<<<<
25123 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
25124 : * index2(r, rs, j+1, j+1), rs[1], c, s)
25125 : */
25126 1950 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_m);
25127 1950 : if (__pyx_t_4) {
25128 :
25129 : /* "scipy/linalg/_decomp_update.pyx":1042
25130 : * # update the rest of r
25131 : * if j+1 < m:
25132 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1], # <<<<<<<<<<<<<<
25133 : * index2(r, rs, j+1, j+1), rs[1], c, s)
25134 : *
25135 : */
25136 1950 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_c, __pyx_v_s);
25137 :
25138 : /* "scipy/linalg/_decomp_update.pyx":1041
25139 : *
25140 : * # update the rest of r
25141 : * if j+1 < m: # <<<<<<<<<<<<<<
25142 : * rot(n-j-1, index2(r, rs, j, j+1), rs[1],
25143 : * index2(r, rs, j+1, j+1), rs[1], c, s)
25144 : */
25145 : }
25146 :
25147 : /* "scipy/linalg/_decomp_update.pyx":1046
25148 : *
25149 : * # update q
25150 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate()) # <<<<<<<<<<<<<<
25151 : *
25152 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs,
25153 : */
25154 1950 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_rot(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, __pyx_v_j), (__pyx_v_qs[0]), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(__pyx_v_q, __pyx_v_qs, (__pyx_v_j + 1)), (__pyx_v_qs[0]), __pyx_v_c, __Pyx_c_conj_double(__pyx_v_s));
25155 : }
25156 :
25157 : /* "scipy/linalg/_decomp_update.pyx":1027
25158 : * return 0
25159 : *
25160 : * cdef void hessenberg_qr(int m, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
25161 : * int k) noexcept nogil:
25162 : * """Reduce an upper hessenberg matrix r, to upper triangular, starting in
25163 : */
25164 :
25165 : /* function exit code */
25166 333 : }
25167 :
25168 : /* "scipy/linalg/_decomp_update.pyx":1048
25169 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
25170 : *
25171 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
25172 : * int k, int p, blas_t* work) noexcept nogil:
25173 : * """ Reduce a matrix r to upper triangular form by eliminating the lower p
25174 : */
25175 :
25176 387 : static void __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, float *__pyx_v_q, int *__pyx_v_qs, float *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p, float *__pyx_v_work) {
25177 387 : int __pyx_v_j;
25178 387 : int __pyx_v_last;
25179 387 : float __pyx_v_tau;
25180 387 : float __pyx_v_rjj;
25181 387 : int __pyx_v_limit;
25182 387 : char *__pyx_v_sideR;
25183 387 : char *__pyx_v_sideL;
25184 387 : int __pyx_t_1;
25185 387 : long __pyx_t_2;
25186 387 : long __pyx_t_3;
25187 387 : int __pyx_t_4;
25188 387 : int __pyx_t_5;
25189 387 : int __pyx_t_6;
25190 387 : int __pyx_t_7;
25191 :
25192 : /* "scipy/linalg/_decomp_update.pyx":1060
25193 : * cdef blas_t tau
25194 : * cdef blas_t rjj
25195 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
25196 : * cdef char* sideR = 'R'
25197 : * cdef char* sideL = 'L'
25198 : */
25199 387 : __pyx_t_1 = __pyx_v_n;
25200 387 : __pyx_t_2 = (__pyx_v_m - 1);
25201 387 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
25202 387 : if (__pyx_t_4) {
25203 : __pyx_t_3 = __pyx_t_1;
25204 : } else {
25205 : __pyx_t_3 = __pyx_t_2;
25206 : }
25207 387 : __pyx_v_limit = __pyx_t_3;
25208 :
25209 : /* "scipy/linalg/_decomp_update.pyx":1061
25210 : * cdef blas_t rjj
25211 : * cdef int limit = min(m-1, n)
25212 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
25213 : * cdef char* sideL = 'L'
25214 : *
25215 : */
25216 387 : __pyx_v_sideR = ((char *)"R");
25217 :
25218 : /* "scipy/linalg/_decomp_update.pyx":1062
25219 : * cdef int limit = min(m-1, n)
25220 : * cdef char* sideR = 'R'
25221 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
25222 : *
25223 : * # R now has p subdiagonal values to be removed starting from col k.
25224 : */
25225 387 : __pyx_v_sideL = ((char *)"L");
25226 :
25227 : /* "scipy/linalg/_decomp_update.pyx":1065
25228 : *
25229 : * # R now has p subdiagonal values to be removed starting from col k.
25230 : * for j in range(k, limit): # <<<<<<<<<<<<<<
25231 : * # length of the reflector
25232 : * last = min(p+1, o-j)
25233 : */
25234 387 : __pyx_t_1 = __pyx_v_limit;
25235 387 : __pyx_t_5 = __pyx_t_1;
25236 2353 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25237 1966 : __pyx_v_j = __pyx_t_6;
25238 :
25239 : /* "scipy/linalg/_decomp_update.pyx":1067
25240 : * for j in range(k, limit):
25241 : * # length of the reflector
25242 : * last = min(p+1, o-j) # <<<<<<<<<<<<<<
25243 : * rjj = index2(r, rs, j, j)[0]
25244 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25245 : */
25246 1966 : __pyx_t_7 = (__pyx_v_o - __pyx_v_j);
25247 1966 : __pyx_t_3 = (__pyx_v_p + 1);
25248 1966 : __pyx_t_4 = (__pyx_t_7 < __pyx_t_3);
25249 1966 : if (__pyx_t_4) {
25250 : __pyx_t_2 = __pyx_t_7;
25251 : } else {
25252 : __pyx_t_2 = __pyx_t_3;
25253 : }
25254 1966 : __pyx_v_last = __pyx_t_2;
25255 :
25256 : /* "scipy/linalg/_decomp_update.pyx":1068
25257 : * # length of the reflector
25258 : * last = min(p+1, o-j)
25259 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
25260 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25261 : * index2(r, rs, j, j)[0] = 1
25262 : */
25263 1966 : __pyx_v_rjj = (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
25264 :
25265 : /* "scipy/linalg/_decomp_update.pyx":1069
25266 : * last = min(p+1, o-j)
25267 : * rjj = index2(r, rs, j, j)[0]
25268 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
25269 : * index2(r, rs, j, j)[0] = 1
25270 : *
25271 : */
25272 1966 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_last, (&__pyx_v_rjj), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
25273 :
25274 : /* "scipy/linalg/_decomp_update.pyx":1070
25275 : * rjj = index2(r, rs, j, j)[0]
25276 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25277 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
25278 : *
25279 : * # apply the reflector to r if necessary
25280 : */
25281 1966 : (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = 1.0;
25282 :
25283 : /* "scipy/linalg/_decomp_update.pyx":1073
25284 : *
25285 : * # apply the reflector to r if necessary
25286 : * if j+1 < n: # <<<<<<<<<<<<<<
25287 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25288 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25289 : */
25290 1966 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
25291 1966 : if (__pyx_t_4) {
25292 :
25293 : /* "scipy/linalg/_decomp_update.pyx":1074
25294 : * # apply the reflector to r if necessary
25295 : * if j+1 < n:
25296 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
25297 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25298 : *
25299 : */
25300 1826 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_last, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), (__pyx_v_tau), __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
25301 :
25302 : /* "scipy/linalg/_decomp_update.pyx":1073
25303 : *
25304 : * # apply the reflector to r if necessary
25305 : * if j+1 < n: # <<<<<<<<<<<<<<
25306 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25307 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25308 : */
25309 : }
25310 :
25311 : /* "scipy/linalg/_decomp_update.pyx":1078
25312 : *
25313 : * # apply the reflector to q
25314 : * larf(sideR, m, last, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
25315 : * index2(q, qs, 0, j), qs[1], work)
25316 : *
25317 : */
25318 1966 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_last, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
25319 :
25320 : /* "scipy/linalg/_decomp_update.pyx":1082
25321 : *
25322 : * # rezero the householder vector we no longer need.
25323 : * memset(index2(r, rs, j+1, j), 0, (last-1)*sizeof(blas_t)) # <<<<<<<<<<<<<<
25324 : *
25325 : * # restore the rjj element
25326 : */
25327 1966 : (void)(memset(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), 0, ((__pyx_v_last - 1) * (sizeof(float)))));
25328 :
25329 : /* "scipy/linalg/_decomp_update.pyx":1085
25330 : *
25331 : * # restore the rjj element
25332 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
25333 : *
25334 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u,
25335 : */
25336 1966 : (__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
25337 : }
25338 :
25339 : /* "scipy/linalg/_decomp_update.pyx":1048
25340 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
25341 : *
25342 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
25343 : * int k, int p, blas_t* work) noexcept nogil:
25344 : * """ Reduce a matrix r to upper triangular form by eliminating the lower p
25345 : */
25346 :
25347 : /* function exit code */
25348 387 : }
25349 :
25350 387 : static void __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, double *__pyx_v_q, int *__pyx_v_qs, double *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p, double *__pyx_v_work) {
25351 387 : int __pyx_v_j;
25352 387 : int __pyx_v_last;
25353 387 : double __pyx_v_tau;
25354 387 : double __pyx_v_rjj;
25355 387 : int __pyx_v_limit;
25356 387 : char *__pyx_v_sideR;
25357 387 : char *__pyx_v_sideL;
25358 387 : int __pyx_t_1;
25359 387 : long __pyx_t_2;
25360 387 : long __pyx_t_3;
25361 387 : int __pyx_t_4;
25362 387 : int __pyx_t_5;
25363 387 : int __pyx_t_6;
25364 387 : int __pyx_t_7;
25365 :
25366 : /* "scipy/linalg/_decomp_update.pyx":1060
25367 : * cdef blas_t tau
25368 : * cdef blas_t rjj
25369 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
25370 : * cdef char* sideR = 'R'
25371 : * cdef char* sideL = 'L'
25372 : */
25373 387 : __pyx_t_1 = __pyx_v_n;
25374 387 : __pyx_t_2 = (__pyx_v_m - 1);
25375 387 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
25376 387 : if (__pyx_t_4) {
25377 : __pyx_t_3 = __pyx_t_1;
25378 : } else {
25379 : __pyx_t_3 = __pyx_t_2;
25380 : }
25381 387 : __pyx_v_limit = __pyx_t_3;
25382 :
25383 : /* "scipy/linalg/_decomp_update.pyx":1061
25384 : * cdef blas_t rjj
25385 : * cdef int limit = min(m-1, n)
25386 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
25387 : * cdef char* sideL = 'L'
25388 : *
25389 : */
25390 387 : __pyx_v_sideR = ((char *)"R");
25391 :
25392 : /* "scipy/linalg/_decomp_update.pyx":1062
25393 : * cdef int limit = min(m-1, n)
25394 : * cdef char* sideR = 'R'
25395 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
25396 : *
25397 : * # R now has p subdiagonal values to be removed starting from col k.
25398 : */
25399 387 : __pyx_v_sideL = ((char *)"L");
25400 :
25401 : /* "scipy/linalg/_decomp_update.pyx":1065
25402 : *
25403 : * # R now has p subdiagonal values to be removed starting from col k.
25404 : * for j in range(k, limit): # <<<<<<<<<<<<<<
25405 : * # length of the reflector
25406 : * last = min(p+1, o-j)
25407 : */
25408 387 : __pyx_t_1 = __pyx_v_limit;
25409 387 : __pyx_t_5 = __pyx_t_1;
25410 2353 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25411 1966 : __pyx_v_j = __pyx_t_6;
25412 :
25413 : /* "scipy/linalg/_decomp_update.pyx":1067
25414 : * for j in range(k, limit):
25415 : * # length of the reflector
25416 : * last = min(p+1, o-j) # <<<<<<<<<<<<<<
25417 : * rjj = index2(r, rs, j, j)[0]
25418 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25419 : */
25420 1966 : __pyx_t_7 = (__pyx_v_o - __pyx_v_j);
25421 1966 : __pyx_t_3 = (__pyx_v_p + 1);
25422 1966 : __pyx_t_4 = (__pyx_t_7 < __pyx_t_3);
25423 1966 : if (__pyx_t_4) {
25424 : __pyx_t_2 = __pyx_t_7;
25425 : } else {
25426 : __pyx_t_2 = __pyx_t_3;
25427 : }
25428 1966 : __pyx_v_last = __pyx_t_2;
25429 :
25430 : /* "scipy/linalg/_decomp_update.pyx":1068
25431 : * # length of the reflector
25432 : * last = min(p+1, o-j)
25433 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
25434 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25435 : * index2(r, rs, j, j)[0] = 1
25436 : */
25437 1966 : __pyx_v_rjj = (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
25438 :
25439 : /* "scipy/linalg/_decomp_update.pyx":1069
25440 : * last = min(p+1, o-j)
25441 : * rjj = index2(r, rs, j, j)[0]
25442 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
25443 : * index2(r, rs, j, j)[0] = 1
25444 : *
25445 : */
25446 1966 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_last, (&__pyx_v_rjj), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
25447 :
25448 : /* "scipy/linalg/_decomp_update.pyx":1070
25449 : * rjj = index2(r, rs, j, j)[0]
25450 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25451 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
25452 : *
25453 : * # apply the reflector to r if necessary
25454 : */
25455 1966 : (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = 1.0;
25456 :
25457 : /* "scipy/linalg/_decomp_update.pyx":1073
25458 : *
25459 : * # apply the reflector to r if necessary
25460 : * if j+1 < n: # <<<<<<<<<<<<<<
25461 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25462 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25463 : */
25464 1966 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
25465 1966 : if (__pyx_t_4) {
25466 :
25467 : /* "scipy/linalg/_decomp_update.pyx":1074
25468 : * # apply the reflector to r if necessary
25469 : * if j+1 < n:
25470 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
25471 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25472 : *
25473 : */
25474 1826 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_last, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), (__pyx_v_tau), __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
25475 :
25476 : /* "scipy/linalg/_decomp_update.pyx":1073
25477 : *
25478 : * # apply the reflector to r if necessary
25479 : * if j+1 < n: # <<<<<<<<<<<<<<
25480 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25481 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25482 : */
25483 : }
25484 :
25485 : /* "scipy/linalg/_decomp_update.pyx":1078
25486 : *
25487 : * # apply the reflector to q
25488 : * larf(sideR, m, last, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
25489 : * index2(q, qs, 0, j), qs[1], work)
25490 : *
25491 : */
25492 1966 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_last, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
25493 :
25494 : /* "scipy/linalg/_decomp_update.pyx":1082
25495 : *
25496 : * # rezero the householder vector we no longer need.
25497 : * memset(index2(r, rs, j+1, j), 0, (last-1)*sizeof(blas_t)) # <<<<<<<<<<<<<<
25498 : *
25499 : * # restore the rjj element
25500 : */
25501 1966 : (void)(memset(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), 0, ((__pyx_v_last - 1) * (sizeof(double)))));
25502 :
25503 : /* "scipy/linalg/_decomp_update.pyx":1085
25504 : *
25505 : * # restore the rjj element
25506 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
25507 : *
25508 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u,
25509 : */
25510 1966 : (__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
25511 : }
25512 :
25513 : /* "scipy/linalg/_decomp_update.pyx":1048
25514 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
25515 : *
25516 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
25517 : * int k, int p, blas_t* work) noexcept nogil:
25518 : * """ Reduce a matrix r to upper triangular form by eliminating the lower p
25519 : */
25520 :
25521 : /* function exit code */
25522 387 : }
25523 :
25524 387 : static void __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_float_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p, __pyx_t_float_complex *__pyx_v_work) {
25525 387 : int __pyx_v_j;
25526 387 : int __pyx_v_last;
25527 387 : __pyx_t_float_complex __pyx_v_tau;
25528 387 : __pyx_t_float_complex __pyx_v_rjj;
25529 387 : int __pyx_v_limit;
25530 387 : char *__pyx_v_sideR;
25531 387 : char *__pyx_v_sideL;
25532 387 : int __pyx_t_1;
25533 387 : long __pyx_t_2;
25534 387 : long __pyx_t_3;
25535 387 : int __pyx_t_4;
25536 387 : int __pyx_t_5;
25537 387 : int __pyx_t_6;
25538 387 : int __pyx_t_7;
25539 :
25540 : /* "scipy/linalg/_decomp_update.pyx":1060
25541 : * cdef blas_t tau
25542 : * cdef blas_t rjj
25543 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
25544 : * cdef char* sideR = 'R'
25545 : * cdef char* sideL = 'L'
25546 : */
25547 387 : __pyx_t_1 = __pyx_v_n;
25548 387 : __pyx_t_2 = (__pyx_v_m - 1);
25549 387 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
25550 387 : if (__pyx_t_4) {
25551 : __pyx_t_3 = __pyx_t_1;
25552 : } else {
25553 : __pyx_t_3 = __pyx_t_2;
25554 : }
25555 387 : __pyx_v_limit = __pyx_t_3;
25556 :
25557 : /* "scipy/linalg/_decomp_update.pyx":1061
25558 : * cdef blas_t rjj
25559 : * cdef int limit = min(m-1, n)
25560 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
25561 : * cdef char* sideL = 'L'
25562 : *
25563 : */
25564 387 : __pyx_v_sideR = ((char *)"R");
25565 :
25566 : /* "scipy/linalg/_decomp_update.pyx":1062
25567 : * cdef int limit = min(m-1, n)
25568 : * cdef char* sideR = 'R'
25569 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
25570 : *
25571 : * # R now has p subdiagonal values to be removed starting from col k.
25572 : */
25573 387 : __pyx_v_sideL = ((char *)"L");
25574 :
25575 : /* "scipy/linalg/_decomp_update.pyx":1065
25576 : *
25577 : * # R now has p subdiagonal values to be removed starting from col k.
25578 : * for j in range(k, limit): # <<<<<<<<<<<<<<
25579 : * # length of the reflector
25580 : * last = min(p+1, o-j)
25581 : */
25582 387 : __pyx_t_1 = __pyx_v_limit;
25583 387 : __pyx_t_5 = __pyx_t_1;
25584 2353 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25585 1966 : __pyx_v_j = __pyx_t_6;
25586 :
25587 : /* "scipy/linalg/_decomp_update.pyx":1067
25588 : * for j in range(k, limit):
25589 : * # length of the reflector
25590 : * last = min(p+1, o-j) # <<<<<<<<<<<<<<
25591 : * rjj = index2(r, rs, j, j)[0]
25592 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25593 : */
25594 1966 : __pyx_t_7 = (__pyx_v_o - __pyx_v_j);
25595 1966 : __pyx_t_3 = (__pyx_v_p + 1);
25596 1966 : __pyx_t_4 = (__pyx_t_7 < __pyx_t_3);
25597 1966 : if (__pyx_t_4) {
25598 : __pyx_t_2 = __pyx_t_7;
25599 : } else {
25600 : __pyx_t_2 = __pyx_t_3;
25601 : }
25602 1966 : __pyx_v_last = __pyx_t_2;
25603 :
25604 : /* "scipy/linalg/_decomp_update.pyx":1068
25605 : * # length of the reflector
25606 : * last = min(p+1, o-j)
25607 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
25608 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25609 : * index2(r, rs, j, j)[0] = 1
25610 : */
25611 1966 : __pyx_v_rjj = (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
25612 :
25613 : /* "scipy/linalg/_decomp_update.pyx":1069
25614 : * last = min(p+1, o-j)
25615 : * rjj = index2(r, rs, j, j)[0]
25616 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
25617 : * index2(r, rs, j, j)[0] = 1
25618 : *
25619 : */
25620 1966 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_last, (&__pyx_v_rjj), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
25621 :
25622 : /* "scipy/linalg/_decomp_update.pyx":1070
25623 : * rjj = index2(r, rs, j, j)[0]
25624 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25625 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
25626 : *
25627 : * # apply the reflector to r if necessary
25628 : */
25629 1966 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_t_float_complex_from_parts(1, 0);
25630 :
25631 : /* "scipy/linalg/_decomp_update.pyx":1073
25632 : *
25633 : * # apply the reflector to r if necessary
25634 : * if j+1 < n: # <<<<<<<<<<<<<<
25635 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25636 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25637 : */
25638 1966 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
25639 1966 : if (__pyx_t_4) {
25640 :
25641 : /* "scipy/linalg/_decomp_update.pyx":1074
25642 : * # apply the reflector to r if necessary
25643 : * if j+1 < n:
25644 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
25645 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25646 : *
25647 : */
25648 1826 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_last, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __Pyx_c_conj_float(__pyx_v_tau), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
25649 :
25650 : /* "scipy/linalg/_decomp_update.pyx":1073
25651 : *
25652 : * # apply the reflector to r if necessary
25653 : * if j+1 < n: # <<<<<<<<<<<<<<
25654 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25655 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25656 : */
25657 : }
25658 :
25659 : /* "scipy/linalg/_decomp_update.pyx":1078
25660 : *
25661 : * # apply the reflector to q
25662 : * larf(sideR, m, last, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
25663 : * index2(q, qs, 0, j), qs[1], work)
25664 : *
25665 : */
25666 1966 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_last, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
25667 :
25668 : /* "scipy/linalg/_decomp_update.pyx":1082
25669 : *
25670 : * # rezero the householder vector we no longer need.
25671 : * memset(index2(r, rs, j+1, j), 0, (last-1)*sizeof(blas_t)) # <<<<<<<<<<<<<<
25672 : *
25673 : * # restore the rjj element
25674 : */
25675 1966 : (void)(memset(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), 0, ((__pyx_v_last - 1) * (sizeof(__pyx_t_float_complex)))));
25676 :
25677 : /* "scipy/linalg/_decomp_update.pyx":1085
25678 : *
25679 : * # restore the rjj element
25680 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
25681 : *
25682 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u,
25683 : */
25684 1966 : (__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
25685 : }
25686 :
25687 : /* "scipy/linalg/_decomp_update.pyx":1048
25688 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
25689 : *
25690 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
25691 : * int k, int p, blas_t* work) noexcept nogil:
25692 : * """ Reduce a matrix r to upper triangular form by eliminating the lower p
25693 : */
25694 :
25695 : /* function exit code */
25696 387 : }
25697 :
25698 387 : static void __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_p_subdiag_qr(int __pyx_v_m, int __pyx_v_o, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, int *__pyx_v_qs, __pyx_t_double_complex *__pyx_v_r, int *__pyx_v_rs, int __pyx_v_k, int __pyx_v_p, __pyx_t_double_complex *__pyx_v_work) {
25699 387 : int __pyx_v_j;
25700 387 : int __pyx_v_last;
25701 387 : __pyx_t_double_complex __pyx_v_tau;
25702 387 : __pyx_t_double_complex __pyx_v_rjj;
25703 387 : int __pyx_v_limit;
25704 387 : char *__pyx_v_sideR;
25705 387 : char *__pyx_v_sideL;
25706 387 : int __pyx_t_1;
25707 387 : long __pyx_t_2;
25708 387 : long __pyx_t_3;
25709 387 : int __pyx_t_4;
25710 387 : int __pyx_t_5;
25711 387 : int __pyx_t_6;
25712 387 : int __pyx_t_7;
25713 :
25714 : /* "scipy/linalg/_decomp_update.pyx":1060
25715 : * cdef blas_t tau
25716 : * cdef blas_t rjj
25717 : * cdef int limit = min(m-1, n) # <<<<<<<<<<<<<<
25718 : * cdef char* sideR = 'R'
25719 : * cdef char* sideL = 'L'
25720 : */
25721 387 : __pyx_t_1 = __pyx_v_n;
25722 387 : __pyx_t_2 = (__pyx_v_m - 1);
25723 387 : __pyx_t_4 = (__pyx_t_1 < __pyx_t_2);
25724 387 : if (__pyx_t_4) {
25725 : __pyx_t_3 = __pyx_t_1;
25726 : } else {
25727 : __pyx_t_3 = __pyx_t_2;
25728 : }
25729 387 : __pyx_v_limit = __pyx_t_3;
25730 :
25731 : /* "scipy/linalg/_decomp_update.pyx":1061
25732 : * cdef blas_t rjj
25733 : * cdef int limit = min(m-1, n)
25734 : * cdef char* sideR = 'R' # <<<<<<<<<<<<<<
25735 : * cdef char* sideL = 'L'
25736 : *
25737 : */
25738 387 : __pyx_v_sideR = ((char *)"R");
25739 :
25740 : /* "scipy/linalg/_decomp_update.pyx":1062
25741 : * cdef int limit = min(m-1, n)
25742 : * cdef char* sideR = 'R'
25743 : * cdef char* sideL = 'L' # <<<<<<<<<<<<<<
25744 : *
25745 : * # R now has p subdiagonal values to be removed starting from col k.
25746 : */
25747 387 : __pyx_v_sideL = ((char *)"L");
25748 :
25749 : /* "scipy/linalg/_decomp_update.pyx":1065
25750 : *
25751 : * # R now has p subdiagonal values to be removed starting from col k.
25752 : * for j in range(k, limit): # <<<<<<<<<<<<<<
25753 : * # length of the reflector
25754 : * last = min(p+1, o-j)
25755 : */
25756 387 : __pyx_t_1 = __pyx_v_limit;
25757 387 : __pyx_t_5 = __pyx_t_1;
25758 2353 : for (__pyx_t_6 = __pyx_v_k; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
25759 1966 : __pyx_v_j = __pyx_t_6;
25760 :
25761 : /* "scipy/linalg/_decomp_update.pyx":1067
25762 : * for j in range(k, limit):
25763 : * # length of the reflector
25764 : * last = min(p+1, o-j) # <<<<<<<<<<<<<<
25765 : * rjj = index2(r, rs, j, j)[0]
25766 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25767 : */
25768 1966 : __pyx_t_7 = (__pyx_v_o - __pyx_v_j);
25769 1966 : __pyx_t_3 = (__pyx_v_p + 1);
25770 1966 : __pyx_t_4 = (__pyx_t_7 < __pyx_t_3);
25771 1966 : if (__pyx_t_4) {
25772 : __pyx_t_2 = __pyx_t_7;
25773 : } else {
25774 : __pyx_t_2 = __pyx_t_3;
25775 : }
25776 1966 : __pyx_v_last = __pyx_t_2;
25777 :
25778 : /* "scipy/linalg/_decomp_update.pyx":1068
25779 : * # length of the reflector
25780 : * last = min(p+1, o-j)
25781 : * rjj = index2(r, rs, j, j)[0] # <<<<<<<<<<<<<<
25782 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25783 : * index2(r, rs, j, j)[0] = 1
25784 : */
25785 1966 : __pyx_v_rjj = (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]);
25786 :
25787 : /* "scipy/linalg/_decomp_update.pyx":1069
25788 : * last = min(p+1, o-j)
25789 : * rjj = index2(r, rs, j, j)[0]
25790 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau) # <<<<<<<<<<<<<<
25791 : * index2(r, rs, j, j)[0] = 1
25792 : *
25793 : */
25794 1966 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larfg(__pyx_v_last, (&__pyx_v_rjj), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), (__pyx_v_rs[0]), (&__pyx_v_tau));
25795 :
25796 : /* "scipy/linalg/_decomp_update.pyx":1070
25797 : * rjj = index2(r, rs, j, j)[0]
25798 : * larfg(last, &rjj, index2(r, rs, j+1, j), rs[0], &tau)
25799 : * index2(r, rs, j, j)[0] = 1 # <<<<<<<<<<<<<<
25800 : *
25801 : * # apply the reflector to r if necessary
25802 : */
25803 1966 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_t_double_complex_from_parts(1, 0);
25804 :
25805 : /* "scipy/linalg/_decomp_update.pyx":1073
25806 : *
25807 : * # apply the reflector to r if necessary
25808 : * if j+1 < n: # <<<<<<<<<<<<<<
25809 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25810 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25811 : */
25812 1966 : __pyx_t_4 = ((__pyx_v_j + 1) < __pyx_v_n);
25813 1966 : if (__pyx_t_4) {
25814 :
25815 : /* "scipy/linalg/_decomp_update.pyx":1074
25816 : * # apply the reflector to r if necessary
25817 : * if j+1 < n:
25818 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0], # <<<<<<<<<<<<<<
25819 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25820 : *
25821 : */
25822 1826 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideL, __pyx_v_last, ((__pyx_v_n - __pyx_v_j) - 1), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __Pyx_c_conj_double(__pyx_v_tau), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, (__pyx_v_j + 1)), (__pyx_v_rs[1]), __pyx_v_work);
25823 :
25824 : /* "scipy/linalg/_decomp_update.pyx":1073
25825 : *
25826 : * # apply the reflector to r if necessary
25827 : * if j+1 < n: # <<<<<<<<<<<<<<
25828 : * larf(sideL, last, n-j-1, index2(r, rs, j, j), rs[0],
25829 : * tau.conjugate(), index2(r, rs, j, j+1), rs[1], work)
25830 : */
25831 : }
25832 :
25833 : /* "scipy/linalg/_decomp_update.pyx":1078
25834 : *
25835 : * # apply the reflector to q
25836 : * larf(sideR, m, last, index2(r, rs, j, j), rs[0], tau, # <<<<<<<<<<<<<<
25837 : * index2(q, qs, 0, j), qs[1], work)
25838 : *
25839 : */
25840 1966 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_larf(__pyx_v_sideR, __pyx_v_m, __pyx_v_last, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j), (__pyx_v_rs[0]), __pyx_v_tau, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_q, __pyx_v_qs, 0, __pyx_v_j), (__pyx_v_qs[1]), __pyx_v_work);
25841 :
25842 : /* "scipy/linalg/_decomp_update.pyx":1082
25843 : *
25844 : * # rezero the householder vector we no longer need.
25845 : * memset(index2(r, rs, j+1, j), 0, (last-1)*sizeof(blas_t)) # <<<<<<<<<<<<<<
25846 : *
25847 : * # restore the rjj element
25848 : */
25849 1966 : (void)(memset(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, (__pyx_v_j + 1), __pyx_v_j), 0, ((__pyx_v_last - 1) * (sizeof(__pyx_t_double_complex)))));
25850 :
25851 : /* "scipy/linalg/_decomp_update.pyx":1085
25852 : *
25853 : * # restore the rjj element
25854 : * index2(r, rs, j, j)[0] = rjj # <<<<<<<<<<<<<<
25855 : *
25856 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u,
25857 : */
25858 1966 : (__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_index2(__pyx_v_r, __pyx_v_rs, __pyx_v_j, __pyx_v_j)[0]) = __pyx_v_rjj;
25859 : }
25860 :
25861 : /* "scipy/linalg/_decomp_update.pyx":1048
25862 : * rot(m, col(q, qs, j), qs[0], col(q, qs, j+1), qs[0], c, s.conjugate())
25863 : *
25864 : * cdef void p_subdiag_qr(int m, int o, int n, blas_t* q, int* qs, blas_t* r, int* rs, # <<<<<<<<<<<<<<
25865 : * int k, int p, blas_t* work) noexcept nogil:
25866 : * """ Reduce a matrix r to upper triangular form by eliminating the lower p
25867 : */
25868 :
25869 : /* function exit code */
25870 387 : }
25871 :
25872 : /* "scipy/linalg/_decomp_update.pyx":1087
25873 : * index2(r, rs, j, j)[0] = rjj
25874 : *
25875 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u, # <<<<<<<<<<<<<<
25876 : * int* us, blas_t* s, blas_t* RCOND) noexcept nogil:
25877 : * """Given a (m,n) matrix q with orthonormal columns and a (m,) vector u,
25878 : */
25879 :
25880 299 : static int __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int __pyx_v_m, int __pyx_v_n, float *__pyx_v_q, CYTHON_UNUSED int *__pyx_v_qs, int __pyx_v_qisF, float *__pyx_v_u, int *__pyx_v_us, float *__pyx_v_s, float *__pyx_v_RCOND) {
25881 299 : float __pyx_v_unorm;
25882 299 : float __pyx_v_snorm;
25883 299 : float __pyx_v_wnorm;
25884 299 : float __pyx_v_wpnorm;
25885 299 : float __pyx_v_sigma_max;
25886 299 : float __pyx_v_sigma_min;
25887 299 : float __pyx_v_rc;
25888 299 : char *__pyx_v_T;
25889 299 : char *__pyx_v_N;
25890 299 : CYTHON_UNUSED char *__pyx_v_C;
25891 299 : CYTHON_UNUSED int __pyx_v_ss;
25892 299 : float __pyx_v_inv_root2;
25893 299 : int __pyx_r;
25894 299 : int __pyx_t_1;
25895 299 : int __pyx_lineno = 0;
25896 299 : const char *__pyx_filename = NULL;
25897 299 : int __pyx_clineno = 0;
25898 : #ifdef WITH_THREAD
25899 299 : PyGILState_STATE __pyx_gilstate_save;
25900 : #endif
25901 :
25902 : /* "scipy/linalg/_decomp_update.pyx":1104
25903 : * """
25904 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
25905 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
25906 : * cdef char* N = 'N'
25907 : * cdef char* C = 'C'
25908 : */
25909 299 : __pyx_v_T = ((char *)"T");
25910 :
25911 : /* "scipy/linalg/_decomp_update.pyx":1105
25912 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
25913 : * cdef char* T = 'T'
25914 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
25915 : * cdef char* C = 'C'
25916 : * cdef int ss = 1
25917 : */
25918 299 : __pyx_v_N = ((char *)"N");
25919 :
25920 : /* "scipy/linalg/_decomp_update.pyx":1106
25921 : * cdef char* T = 'T'
25922 : * cdef char* N = 'N'
25923 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
25924 : * cdef int ss = 1
25925 : * cdef blas_t inv_root2 = M_SQRT1_2
25926 : */
25927 299 : __pyx_v_C = ((char *)"C");
25928 :
25929 : /* "scipy/linalg/_decomp_update.pyx":1107
25930 : * cdef char* N = 'N'
25931 : * cdef char* C = 'C'
25932 : * cdef int ss = 1 # <<<<<<<<<<<<<<
25933 : * cdef blas_t inv_root2 = M_SQRT1_2
25934 : *
25935 : */
25936 299 : __pyx_v_ss = 1;
25937 :
25938 : /* "scipy/linalg/_decomp_update.pyx":1108
25939 : * cdef char* C = 'C'
25940 : * cdef int ss = 1
25941 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
25942 : *
25943 : * # normalize u
25944 : */
25945 299 : __pyx_v_inv_root2 = M_SQRT1_2;
25946 :
25947 : /* "scipy/linalg/_decomp_update.pyx":1111
25948 : *
25949 : * # normalize u
25950 : * unorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
25951 : * scal(m, 1/unorm, u, us[0])
25952 : *
25953 : */
25954 299 : __pyx_v_unorm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
25955 :
25956 : /* "scipy/linalg/_decomp_update.pyx":1112
25957 : * # normalize u
25958 : * unorm = nrm2(m, u, us[0])
25959 : * scal(m, 1/unorm, u, us[0]) # <<<<<<<<<<<<<<
25960 : *
25961 : * # decompose u into q's columns.
25962 : */
25963 299 : if (unlikely(__pyx_v_unorm == 0)) {
25964 : #ifdef WITH_THREAD
25965 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
25966 : #endif
25967 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
25968 : #ifdef WITH_THREAD
25969 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
25970 : #endif
25971 0 : __PYX_ERR(0, 1112, __pyx_L1_error)
25972 : }
25973 299 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_unorm), __pyx_v_u, (__pyx_v_us[0]));
25974 :
25975 : /* "scipy/linalg/_decomp_update.pyx":1115
25976 : *
25977 : * # decompose u into q's columns.
25978 : * if qisF: # <<<<<<<<<<<<<<
25979 : * if blas_t is float or blas_t is double:
25980 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
25981 : */
25982 299 : if (__pyx_v_qisF) {
25983 :
25984 : /* "scipy/linalg/_decomp_update.pyx":1117
25985 : * if qisF:
25986 : * if blas_t is float or blas_t is double:
25987 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
25988 : * else:
25989 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1)
25990 : */
25991 273 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), 0.0, __pyx_v_s, 1);
25992 :
25993 : /* "scipy/linalg/_decomp_update.pyx":1115
25994 : *
25995 : * # decompose u into q's columns.
25996 : * if qisF: # <<<<<<<<<<<<<<
25997 : * if blas_t is float or blas_t is double:
25998 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
25999 : */
26000 273 : goto __pyx_L3;
26001 : }
26002 :
26003 : /* "scipy/linalg/_decomp_update.pyx":1121
26004 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1)
26005 : * else:
26006 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
26007 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
26008 : * else:
26009 : */
26010 : /*else*/ {
26011 :
26012 : /* "scipy/linalg/_decomp_update.pyx":1122
26013 : * else:
26014 : * if blas_t is float or blas_t is double:
26015 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
26016 : * else:
26017 : * blas_t_conj(m, u, us)
26018 : */
26019 26 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), 0.0, __pyx_v_s, 1);
26020 : }
26021 299 : __pyx_L3:;
26022 :
26023 : /* "scipy/linalg/_decomp_update.pyx":1130
26024 : *
26025 : * # sigma_max is the largest singular value of q augmented with u/unorm
26026 : * snorm = nrm2(n, s, 1) # <<<<<<<<<<<<<<
26027 : * sigma_max = blas_t_sqrt(1 + snorm)
26028 : *
26029 : */
26030 299 : __pyx_v_snorm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_v_s, 1);
26031 :
26032 : /* "scipy/linalg/_decomp_update.pyx":1131
26033 : * # sigma_max is the largest singular value of q augmented with u/unorm
26034 : * snorm = nrm2(n, s, 1)
26035 : * sigma_max = blas_t_sqrt(1 + snorm) # <<<<<<<<<<<<<<
26036 : *
26037 : * # make u be the part of u that is not in span(q)
26038 : */
26039 299 : __pyx_v_sigma_max = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt((1.0 + __pyx_v_snorm));
26040 :
26041 : /* "scipy/linalg/_decomp_update.pyx":1135
26042 : * # make u be the part of u that is not in span(q)
26043 : * # i.e. u -= q.dot(s)
26044 : * if qisF: # <<<<<<<<<<<<<<
26045 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
26046 : * else:
26047 : */
26048 299 : if (__pyx_v_qisF) {
26049 :
26050 : /* "scipy/linalg/_decomp_update.pyx":1136
26051 : * # i.e. u -= q.dot(s)
26052 : * if qisF:
26053 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26054 : * else:
26055 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
26056 : */
26057 273 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, __pyx_v_m, __pyx_v_s, 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26058 :
26059 : /* "scipy/linalg/_decomp_update.pyx":1135
26060 : * # make u be the part of u that is not in span(q)
26061 : * # i.e. u -= q.dot(s)
26062 : * if qisF: # <<<<<<<<<<<<<<
26063 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
26064 : * else:
26065 : */
26066 273 : goto __pyx_L4;
26067 : }
26068 :
26069 : /* "scipy/linalg/_decomp_update.pyx":1138
26070 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
26071 : * else:
26072 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26073 : * wnorm = nrm2(m, u, us[0])
26074 : *
26075 : */
26076 : /*else*/ {
26077 26 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26078 : }
26079 299 : __pyx_L4:;
26080 :
26081 : /* "scipy/linalg/_decomp_update.pyx":1139
26082 : * else:
26083 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
26084 : * wnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
26085 : *
26086 : * # sigma_min is the smallest singular value of q augmented with u/unorm
26087 : */
26088 299 : __pyx_v_wnorm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
26089 :
26090 : /* "scipy/linalg/_decomp_update.pyx":1144
26091 : * # the others are == 1, since q is orthonormal.
26092 : * with cython.cdivision(True):
26093 : * sigma_min = wnorm / sigma_max # <<<<<<<<<<<<<<
26094 : * rc = sigma_min / sigma_max
26095 : *
26096 : */
26097 299 : __pyx_v_sigma_min = (__pyx_v_wnorm / __pyx_v_sigma_max);
26098 :
26099 : /* "scipy/linalg/_decomp_update.pyx":1145
26100 : * with cython.cdivision(True):
26101 : * sigma_min = wnorm / sigma_max
26102 : * rc = sigma_min / sigma_max # <<<<<<<<<<<<<<
26103 : *
26104 : * # check the conditioning of the problem.
26105 : */
26106 299 : __pyx_v_rc = (__pyx_v_sigma_min / __pyx_v_sigma_max);
26107 :
26108 : /* "scipy/linalg/_decomp_update.pyx":1148
26109 : *
26110 : * # check the conditioning of the problem.
26111 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
26112 : * RCOND[0] = rc
26113 : * return 2
26114 : */
26115 299 : __pyx_t_1 = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_rc, (__pyx_v_RCOND[0]));
26116 299 : if (__pyx_t_1) {
26117 :
26118 : /* "scipy/linalg/_decomp_update.pyx":1149
26119 : * # check the conditioning of the problem.
26120 : * if blas_t_less_than(rc, RCOND[0]):
26121 : * RCOND[0] = rc # <<<<<<<<<<<<<<
26122 : * return 2
26123 : * RCOND[0] = rc
26124 : */
26125 1 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
26126 :
26127 : /* "scipy/linalg/_decomp_update.pyx":1150
26128 : * if blas_t_less_than(rc, RCOND[0]):
26129 : * RCOND[0] = rc
26130 : * return 2 # <<<<<<<<<<<<<<
26131 : * RCOND[0] = rc
26132 : *
26133 : */
26134 1 : __pyx_r = 2;
26135 1 : goto __pyx_L0;
26136 :
26137 : /* "scipy/linalg/_decomp_update.pyx":1148
26138 : *
26139 : * # check the conditioning of the problem.
26140 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
26141 : * RCOND[0] = rc
26142 : * return 2
26143 : */
26144 : }
26145 :
26146 : /* "scipy/linalg/_decomp_update.pyx":1151
26147 : * RCOND[0] = rc
26148 : * return 2
26149 : * RCOND[0] = rc # <<<<<<<<<<<<<<
26150 : *
26151 : * if blas_t_less_than(inv_root2, wnorm):
26152 : */
26153 298 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
26154 :
26155 : /* "scipy/linalg/_decomp_update.pyx":1153
26156 : * RCOND[0] = rc
26157 : *
26158 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
26159 : * with cython.cdivision(True):
26160 : * scal(m, 1/wnorm, u, us[0])
26161 : */
26162 298 : __pyx_t_1 = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
26163 298 : if (__pyx_t_1) {
26164 :
26165 : /* "scipy/linalg/_decomp_update.pyx":1155
26166 : * if blas_t_less_than(inv_root2, wnorm):
26167 : * with cython.cdivision(True):
26168 : * scal(m, 1/wnorm, u, us[0]) # <<<<<<<<<<<<<<
26169 : * scal(n, unorm, s, 1)
26170 : * s[n] = unorm*wnorm
26171 : */
26172 0 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wnorm), __pyx_v_u, (__pyx_v_us[0]));
26173 :
26174 : /* "scipy/linalg/_decomp_update.pyx":1156
26175 : * with cython.cdivision(True):
26176 : * scal(m, 1/wnorm, u, us[0])
26177 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
26178 : * s[n] = unorm*wnorm
26179 : * return 0
26180 : */
26181 0 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
26182 :
26183 : /* "scipy/linalg/_decomp_update.pyx":1157
26184 : * scal(m, 1/wnorm, u, us[0])
26185 : * scal(n, unorm, s, 1)
26186 : * s[n] = unorm*wnorm # <<<<<<<<<<<<<<
26187 : * return 0
26188 : *
26189 : */
26190 0 : (__pyx_v_s[__pyx_v_n]) = (__pyx_v_unorm * __pyx_v_wnorm);
26191 :
26192 : /* "scipy/linalg/_decomp_update.pyx":1158
26193 : * scal(n, unorm, s, 1)
26194 : * s[n] = unorm*wnorm
26195 : * return 0 # <<<<<<<<<<<<<<
26196 : *
26197 : * # if we get here, u does not yet contain the orthogonal vector we are
26198 : */
26199 0 : __pyx_r = 0;
26200 0 : goto __pyx_L0;
26201 :
26202 : /* "scipy/linalg/_decomp_update.pyx":1153
26203 : * RCOND[0] = rc
26204 : *
26205 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
26206 : * with cython.cdivision(True):
26207 : * scal(m, 1/wnorm, u, us[0])
26208 : */
26209 : }
26210 :
26211 : /* "scipy/linalg/_decomp_update.pyx":1163
26212 : * # looking for. According to Reichel, one reorthogonalization will always
26213 : * # be enough.
26214 : * if qisF: # <<<<<<<<<<<<<<
26215 : * if blas_t is float or blas_t is double:
26216 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26217 : */
26218 298 : if (__pyx_v_qisF) {
26219 :
26220 : /* "scipy/linalg/_decomp_update.pyx":1165
26221 : * if qisF:
26222 : * if blas_t is float or blas_t is double:
26223 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
26224 : * else:
26225 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26226 : */
26227 272 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), 0.0, (__pyx_v_s + __pyx_v_n), 1);
26228 :
26229 : /* "scipy/linalg/_decomp_update.pyx":1168
26230 : * else:
26231 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26232 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26233 : * else:
26234 : * if blas_t is float or blas_t is double:
26235 : */
26236 272 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, __pyx_v_m, (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26237 :
26238 : /* "scipy/linalg/_decomp_update.pyx":1163
26239 : * # looking for. According to Reichel, one reorthogonalization will always
26240 : * # be enough.
26241 : * if qisF: # <<<<<<<<<<<<<<
26242 : * if blas_t is float or blas_t is double:
26243 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26244 : */
26245 272 : goto __pyx_L7;
26246 : }
26247 :
26248 : /* "scipy/linalg/_decomp_update.pyx":1170
26249 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0])
26250 : * else:
26251 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
26252 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
26253 : * else:
26254 : */
26255 : /*else*/ {
26256 :
26257 : /* "scipy/linalg/_decomp_update.pyx":1171
26258 : * else:
26259 : * if blas_t is float or blas_t is double:
26260 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
26261 : * else:
26262 : * blas_t_conj(m, u, us)
26263 : */
26264 26 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), 0.0, (__pyx_v_s + __pyx_v_n), 1);
26265 :
26266 : /* "scipy/linalg/_decomp_update.pyx":1177
26267 : * blas_t_conj(m, u, us)
26268 : * blas_t_conj(n, s+n, &ss)
26269 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26270 : *
26271 : * wpnorm = nrm2(m, u, us[0])
26272 : */
26273 26 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26274 : }
26275 298 : __pyx_L7:;
26276 :
26277 : /* "scipy/linalg/_decomp_update.pyx":1179
26278 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
26279 : *
26280 : * wpnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
26281 : *
26282 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
26283 : */
26284 298 : __pyx_v_wpnorm = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
26285 :
26286 : /* "scipy/linalg/_decomp_update.pyx":1181
26287 : * wpnorm = nrm2(m, u, us[0])
26288 : *
26289 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
26290 : * scal(m, 0, u, us[0])
26291 : * axpy(n, 1, s, 1, s+n, 1)
26292 : */
26293 298 : __pyx_t_1 = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_v_wpnorm, (__pyx_v_wnorm * __pyx_v_inv_root2));
26294 298 : if (__pyx_t_1) {
26295 :
26296 : /* "scipy/linalg/_decomp_update.pyx":1182
26297 : *
26298 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
26299 : * scal(m, 0, u, us[0]) # <<<<<<<<<<<<<<
26300 : * axpy(n, 1, s, 1, s+n, 1)
26301 : * scal(n, unorm, s, 1)
26302 : */
26303 1 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, 0.0, __pyx_v_u, (__pyx_v_us[0]));
26304 :
26305 : /* "scipy/linalg/_decomp_update.pyx":1183
26306 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
26307 : * scal(m, 0, u, us[0])
26308 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
26309 : * scal(n, unorm, s, 1)
26310 : * s[n] = 0
26311 : */
26312 1 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
26313 :
26314 : /* "scipy/linalg/_decomp_update.pyx":1184
26315 : * scal(m, 0, u, us[0])
26316 : * axpy(n, 1, s, 1, s+n, 1)
26317 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
26318 : * s[n] = 0
26319 : * return 1
26320 : */
26321 1 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
26322 :
26323 : /* "scipy/linalg/_decomp_update.pyx":1185
26324 : * axpy(n, 1, s, 1, s+n, 1)
26325 : * scal(n, unorm, s, 1)
26326 : * s[n] = 0 # <<<<<<<<<<<<<<
26327 : * return 1
26328 : *
26329 : */
26330 1 : (__pyx_v_s[__pyx_v_n]) = 0.0;
26331 :
26332 : /* "scipy/linalg/_decomp_update.pyx":1186
26333 : * scal(n, unorm, s, 1)
26334 : * s[n] = 0
26335 : * return 1 # <<<<<<<<<<<<<<
26336 : *
26337 : * with cython.cdivision(True):
26338 : */
26339 1 : __pyx_r = 1;
26340 1 : goto __pyx_L0;
26341 :
26342 : /* "scipy/linalg/_decomp_update.pyx":1181
26343 : * wpnorm = nrm2(m, u, us[0])
26344 : *
26345 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
26346 : * scal(m, 0, u, us[0])
26347 : * axpy(n, 1, s, 1, s+n, 1)
26348 : */
26349 : }
26350 :
26351 : /* "scipy/linalg/_decomp_update.pyx":1189
26352 : *
26353 : * with cython.cdivision(True):
26354 : * scal(m, 1/wpnorm, u, us[0]) # <<<<<<<<<<<<<<
26355 : * axpy(n, 1, s, 1, s+n, 1)
26356 : * scal(n, unorm, s, 1)
26357 : */
26358 297 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wpnorm), __pyx_v_u, (__pyx_v_us[0]));
26359 :
26360 : /* "scipy/linalg/_decomp_update.pyx":1190
26361 : * with cython.cdivision(True):
26362 : * scal(m, 1/wpnorm, u, us[0])
26363 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
26364 : * scal(n, unorm, s, 1)
26365 : * s[n] = wpnorm*unorm
26366 : */
26367 297 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
26368 :
26369 : /* "scipy/linalg/_decomp_update.pyx":1191
26370 : * scal(m, 1/wpnorm, u, us[0])
26371 : * axpy(n, 1, s, 1, s+n, 1)
26372 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
26373 : * s[n] = wpnorm*unorm
26374 : * return 0
26375 : */
26376 297 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
26377 :
26378 : /* "scipy/linalg/_decomp_update.pyx":1192
26379 : * axpy(n, 1, s, 1, s+n, 1)
26380 : * scal(n, unorm, s, 1)
26381 : * s[n] = wpnorm*unorm # <<<<<<<<<<<<<<
26382 : * return 0
26383 : *
26384 : */
26385 297 : (__pyx_v_s[__pyx_v_n]) = (__pyx_v_wpnorm * __pyx_v_unorm);
26386 :
26387 : /* "scipy/linalg/_decomp_update.pyx":1193
26388 : * scal(n, unorm, s, 1)
26389 : * s[n] = wpnorm*unorm
26390 : * return 0 # <<<<<<<<<<<<<<
26391 : *
26392 : * def _form_qTu(object a, object b):
26393 : */
26394 297 : __pyx_r = 0;
26395 297 : goto __pyx_L0;
26396 :
26397 : /* "scipy/linalg/_decomp_update.pyx":1087
26398 : * index2(r, rs, j, j)[0] = rjj
26399 : *
26400 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u, # <<<<<<<<<<<<<<
26401 : * int* us, blas_t* s, blas_t* RCOND) noexcept nogil:
26402 : * """Given a (m,n) matrix q with orthonormal columns and a (m,) vector u,
26403 : */
26404 :
26405 : /* function exit code */
26406 0 : __pyx_L1_error:;
26407 : #ifdef WITH_THREAD
26408 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
26409 : #endif
26410 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorth", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
26411 0 : __pyx_r = 0;
26412 : #ifdef WITH_THREAD
26413 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
26414 : #endif
26415 299 : __pyx_L0:;
26416 299 : return __pyx_r;
26417 : }
26418 :
26419 299 : static int __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int __pyx_v_m, int __pyx_v_n, double *__pyx_v_q, CYTHON_UNUSED int *__pyx_v_qs, int __pyx_v_qisF, double *__pyx_v_u, int *__pyx_v_us, double *__pyx_v_s, double *__pyx_v_RCOND) {
26420 299 : double __pyx_v_unorm;
26421 299 : double __pyx_v_snorm;
26422 299 : double __pyx_v_wnorm;
26423 299 : double __pyx_v_wpnorm;
26424 299 : double __pyx_v_sigma_max;
26425 299 : double __pyx_v_sigma_min;
26426 299 : double __pyx_v_rc;
26427 299 : char *__pyx_v_T;
26428 299 : char *__pyx_v_N;
26429 299 : CYTHON_UNUSED char *__pyx_v_C;
26430 299 : CYTHON_UNUSED int __pyx_v_ss;
26431 299 : double __pyx_v_inv_root2;
26432 299 : int __pyx_r;
26433 299 : int __pyx_t_1;
26434 299 : int __pyx_lineno = 0;
26435 299 : const char *__pyx_filename = NULL;
26436 299 : int __pyx_clineno = 0;
26437 : #ifdef WITH_THREAD
26438 299 : PyGILState_STATE __pyx_gilstate_save;
26439 : #endif
26440 :
26441 : /* "scipy/linalg/_decomp_update.pyx":1104
26442 : * """
26443 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
26444 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
26445 : * cdef char* N = 'N'
26446 : * cdef char* C = 'C'
26447 : */
26448 299 : __pyx_v_T = ((char *)"T");
26449 :
26450 : /* "scipy/linalg/_decomp_update.pyx":1105
26451 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
26452 : * cdef char* T = 'T'
26453 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
26454 : * cdef char* C = 'C'
26455 : * cdef int ss = 1
26456 : */
26457 299 : __pyx_v_N = ((char *)"N");
26458 :
26459 : /* "scipy/linalg/_decomp_update.pyx":1106
26460 : * cdef char* T = 'T'
26461 : * cdef char* N = 'N'
26462 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
26463 : * cdef int ss = 1
26464 : * cdef blas_t inv_root2 = M_SQRT1_2
26465 : */
26466 299 : __pyx_v_C = ((char *)"C");
26467 :
26468 : /* "scipy/linalg/_decomp_update.pyx":1107
26469 : * cdef char* N = 'N'
26470 : * cdef char* C = 'C'
26471 : * cdef int ss = 1 # <<<<<<<<<<<<<<
26472 : * cdef blas_t inv_root2 = M_SQRT1_2
26473 : *
26474 : */
26475 299 : __pyx_v_ss = 1;
26476 :
26477 : /* "scipy/linalg/_decomp_update.pyx":1108
26478 : * cdef char* C = 'C'
26479 : * cdef int ss = 1
26480 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
26481 : *
26482 : * # normalize u
26483 : */
26484 299 : __pyx_v_inv_root2 = M_SQRT1_2;
26485 :
26486 : /* "scipy/linalg/_decomp_update.pyx":1111
26487 : *
26488 : * # normalize u
26489 : * unorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
26490 : * scal(m, 1/unorm, u, us[0])
26491 : *
26492 : */
26493 299 : __pyx_v_unorm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
26494 :
26495 : /* "scipy/linalg/_decomp_update.pyx":1112
26496 : * # normalize u
26497 : * unorm = nrm2(m, u, us[0])
26498 : * scal(m, 1/unorm, u, us[0]) # <<<<<<<<<<<<<<
26499 : *
26500 : * # decompose u into q's columns.
26501 : */
26502 299 : if (unlikely(__pyx_v_unorm == 0)) {
26503 : #ifdef WITH_THREAD
26504 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
26505 : #endif
26506 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
26507 : #ifdef WITH_THREAD
26508 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
26509 : #endif
26510 0 : __PYX_ERR(0, 1112, __pyx_L1_error)
26511 : }
26512 299 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_unorm), __pyx_v_u, (__pyx_v_us[0]));
26513 :
26514 : /* "scipy/linalg/_decomp_update.pyx":1115
26515 : *
26516 : * # decompose u into q's columns.
26517 : * if qisF: # <<<<<<<<<<<<<<
26518 : * if blas_t is float or blas_t is double:
26519 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
26520 : */
26521 299 : if (__pyx_v_qisF) {
26522 :
26523 : /* "scipy/linalg/_decomp_update.pyx":1117
26524 : * if qisF:
26525 : * if blas_t is float or blas_t is double:
26526 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
26527 : * else:
26528 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1)
26529 : */
26530 273 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), 0.0, __pyx_v_s, 1);
26531 :
26532 : /* "scipy/linalg/_decomp_update.pyx":1115
26533 : *
26534 : * # decompose u into q's columns.
26535 : * if qisF: # <<<<<<<<<<<<<<
26536 : * if blas_t is float or blas_t is double:
26537 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
26538 : */
26539 273 : goto __pyx_L3;
26540 : }
26541 :
26542 : /* "scipy/linalg/_decomp_update.pyx":1121
26543 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1)
26544 : * else:
26545 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
26546 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
26547 : * else:
26548 : */
26549 : /*else*/ {
26550 :
26551 : /* "scipy/linalg/_decomp_update.pyx":1122
26552 : * else:
26553 : * if blas_t is float or blas_t is double:
26554 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
26555 : * else:
26556 : * blas_t_conj(m, u, us)
26557 : */
26558 26 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), 0.0, __pyx_v_s, 1);
26559 : }
26560 299 : __pyx_L3:;
26561 :
26562 : /* "scipy/linalg/_decomp_update.pyx":1130
26563 : *
26564 : * # sigma_max is the largest singular value of q augmented with u/unorm
26565 : * snorm = nrm2(n, s, 1) # <<<<<<<<<<<<<<
26566 : * sigma_max = blas_t_sqrt(1 + snorm)
26567 : *
26568 : */
26569 299 : __pyx_v_snorm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_v_s, 1);
26570 :
26571 : /* "scipy/linalg/_decomp_update.pyx":1131
26572 : * # sigma_max is the largest singular value of q augmented with u/unorm
26573 : * snorm = nrm2(n, s, 1)
26574 : * sigma_max = blas_t_sqrt(1 + snorm) # <<<<<<<<<<<<<<
26575 : *
26576 : * # make u be the part of u that is not in span(q)
26577 : */
26578 299 : __pyx_v_sigma_max = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt((1.0 + __pyx_v_snorm));
26579 :
26580 : /* "scipy/linalg/_decomp_update.pyx":1135
26581 : * # make u be the part of u that is not in span(q)
26582 : * # i.e. u -= q.dot(s)
26583 : * if qisF: # <<<<<<<<<<<<<<
26584 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
26585 : * else:
26586 : */
26587 299 : if (__pyx_v_qisF) {
26588 :
26589 : /* "scipy/linalg/_decomp_update.pyx":1136
26590 : * # i.e. u -= q.dot(s)
26591 : * if qisF:
26592 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26593 : * else:
26594 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
26595 : */
26596 273 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, __pyx_v_m, __pyx_v_s, 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26597 :
26598 : /* "scipy/linalg/_decomp_update.pyx":1135
26599 : * # make u be the part of u that is not in span(q)
26600 : * # i.e. u -= q.dot(s)
26601 : * if qisF: # <<<<<<<<<<<<<<
26602 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
26603 : * else:
26604 : */
26605 273 : goto __pyx_L4;
26606 : }
26607 :
26608 : /* "scipy/linalg/_decomp_update.pyx":1138
26609 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
26610 : * else:
26611 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26612 : * wnorm = nrm2(m, u, us[0])
26613 : *
26614 : */
26615 : /*else*/ {
26616 26 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26617 : }
26618 299 : __pyx_L4:;
26619 :
26620 : /* "scipy/linalg/_decomp_update.pyx":1139
26621 : * else:
26622 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
26623 : * wnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
26624 : *
26625 : * # sigma_min is the smallest singular value of q augmented with u/unorm
26626 : */
26627 299 : __pyx_v_wnorm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
26628 :
26629 : /* "scipy/linalg/_decomp_update.pyx":1144
26630 : * # the others are == 1, since q is orthonormal.
26631 : * with cython.cdivision(True):
26632 : * sigma_min = wnorm / sigma_max # <<<<<<<<<<<<<<
26633 : * rc = sigma_min / sigma_max
26634 : *
26635 : */
26636 299 : __pyx_v_sigma_min = (__pyx_v_wnorm / __pyx_v_sigma_max);
26637 :
26638 : /* "scipy/linalg/_decomp_update.pyx":1145
26639 : * with cython.cdivision(True):
26640 : * sigma_min = wnorm / sigma_max
26641 : * rc = sigma_min / sigma_max # <<<<<<<<<<<<<<
26642 : *
26643 : * # check the conditioning of the problem.
26644 : */
26645 299 : __pyx_v_rc = (__pyx_v_sigma_min / __pyx_v_sigma_max);
26646 :
26647 : /* "scipy/linalg/_decomp_update.pyx":1148
26648 : *
26649 : * # check the conditioning of the problem.
26650 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
26651 : * RCOND[0] = rc
26652 : * return 2
26653 : */
26654 299 : __pyx_t_1 = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_rc, (__pyx_v_RCOND[0]));
26655 299 : if (__pyx_t_1) {
26656 :
26657 : /* "scipy/linalg/_decomp_update.pyx":1149
26658 : * # check the conditioning of the problem.
26659 : * if blas_t_less_than(rc, RCOND[0]):
26660 : * RCOND[0] = rc # <<<<<<<<<<<<<<
26661 : * return 2
26662 : * RCOND[0] = rc
26663 : */
26664 1 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
26665 :
26666 : /* "scipy/linalg/_decomp_update.pyx":1150
26667 : * if blas_t_less_than(rc, RCOND[0]):
26668 : * RCOND[0] = rc
26669 : * return 2 # <<<<<<<<<<<<<<
26670 : * RCOND[0] = rc
26671 : *
26672 : */
26673 1 : __pyx_r = 2;
26674 1 : goto __pyx_L0;
26675 :
26676 : /* "scipy/linalg/_decomp_update.pyx":1148
26677 : *
26678 : * # check the conditioning of the problem.
26679 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
26680 : * RCOND[0] = rc
26681 : * return 2
26682 : */
26683 : }
26684 :
26685 : /* "scipy/linalg/_decomp_update.pyx":1151
26686 : * RCOND[0] = rc
26687 : * return 2
26688 : * RCOND[0] = rc # <<<<<<<<<<<<<<
26689 : *
26690 : * if blas_t_less_than(inv_root2, wnorm):
26691 : */
26692 298 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
26693 :
26694 : /* "scipy/linalg/_decomp_update.pyx":1153
26695 : * RCOND[0] = rc
26696 : *
26697 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
26698 : * with cython.cdivision(True):
26699 : * scal(m, 1/wnorm, u, us[0])
26700 : */
26701 298 : __pyx_t_1 = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
26702 298 : if (__pyx_t_1) {
26703 :
26704 : /* "scipy/linalg/_decomp_update.pyx":1155
26705 : * if blas_t_less_than(inv_root2, wnorm):
26706 : * with cython.cdivision(True):
26707 : * scal(m, 1/wnorm, u, us[0]) # <<<<<<<<<<<<<<
26708 : * scal(n, unorm, s, 1)
26709 : * s[n] = unorm*wnorm
26710 : */
26711 0 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wnorm), __pyx_v_u, (__pyx_v_us[0]));
26712 :
26713 : /* "scipy/linalg/_decomp_update.pyx":1156
26714 : * with cython.cdivision(True):
26715 : * scal(m, 1/wnorm, u, us[0])
26716 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
26717 : * s[n] = unorm*wnorm
26718 : * return 0
26719 : */
26720 0 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
26721 :
26722 : /* "scipy/linalg/_decomp_update.pyx":1157
26723 : * scal(m, 1/wnorm, u, us[0])
26724 : * scal(n, unorm, s, 1)
26725 : * s[n] = unorm*wnorm # <<<<<<<<<<<<<<
26726 : * return 0
26727 : *
26728 : */
26729 0 : (__pyx_v_s[__pyx_v_n]) = (__pyx_v_unorm * __pyx_v_wnorm);
26730 :
26731 : /* "scipy/linalg/_decomp_update.pyx":1158
26732 : * scal(n, unorm, s, 1)
26733 : * s[n] = unorm*wnorm
26734 : * return 0 # <<<<<<<<<<<<<<
26735 : *
26736 : * # if we get here, u does not yet contain the orthogonal vector we are
26737 : */
26738 0 : __pyx_r = 0;
26739 0 : goto __pyx_L0;
26740 :
26741 : /* "scipy/linalg/_decomp_update.pyx":1153
26742 : * RCOND[0] = rc
26743 : *
26744 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
26745 : * with cython.cdivision(True):
26746 : * scal(m, 1/wnorm, u, us[0])
26747 : */
26748 : }
26749 :
26750 : /* "scipy/linalg/_decomp_update.pyx":1163
26751 : * # looking for. According to Reichel, one reorthogonalization will always
26752 : * # be enough.
26753 : * if qisF: # <<<<<<<<<<<<<<
26754 : * if blas_t is float or blas_t is double:
26755 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26756 : */
26757 298 : if (__pyx_v_qisF) {
26758 :
26759 : /* "scipy/linalg/_decomp_update.pyx":1165
26760 : * if qisF:
26761 : * if blas_t is float or blas_t is double:
26762 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
26763 : * else:
26764 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26765 : */
26766 272 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), 0.0, (__pyx_v_s + __pyx_v_n), 1);
26767 :
26768 : /* "scipy/linalg/_decomp_update.pyx":1168
26769 : * else:
26770 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26771 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26772 : * else:
26773 : * if blas_t is float or blas_t is double:
26774 : */
26775 272 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, -1.0, __pyx_v_q, __pyx_v_m, (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26776 :
26777 : /* "scipy/linalg/_decomp_update.pyx":1163
26778 : * # looking for. According to Reichel, one reorthogonalization will always
26779 : * # be enough.
26780 : * if qisF: # <<<<<<<<<<<<<<
26781 : * if blas_t is float or blas_t is double:
26782 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
26783 : */
26784 272 : goto __pyx_L7;
26785 : }
26786 :
26787 : /* "scipy/linalg/_decomp_update.pyx":1170
26788 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0])
26789 : * else:
26790 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
26791 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
26792 : * else:
26793 : */
26794 : /*else*/ {
26795 :
26796 : /* "scipy/linalg/_decomp_update.pyx":1171
26797 : * else:
26798 : * if blas_t is float or blas_t is double:
26799 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
26800 : * else:
26801 : * blas_t_conj(m, u, us)
26802 : */
26803 26 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, 1.0, __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), 0.0, (__pyx_v_s + __pyx_v_n), 1);
26804 :
26805 : /* "scipy/linalg/_decomp_update.pyx":1177
26806 : * blas_t_conj(m, u, us)
26807 : * blas_t_conj(n, s+n, &ss)
26808 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
26809 : *
26810 : * wpnorm = nrm2(m, u, us[0])
26811 : */
26812 26 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, -1.0, __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, 1.0, __pyx_v_u, (__pyx_v_us[0]));
26813 : }
26814 298 : __pyx_L7:;
26815 :
26816 : /* "scipy/linalg/_decomp_update.pyx":1179
26817 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
26818 : *
26819 : * wpnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
26820 : *
26821 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
26822 : */
26823 298 : __pyx_v_wpnorm = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
26824 :
26825 : /* "scipy/linalg/_decomp_update.pyx":1181
26826 : * wpnorm = nrm2(m, u, us[0])
26827 : *
26828 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
26829 : * scal(m, 0, u, us[0])
26830 : * axpy(n, 1, s, 1, s+n, 1)
26831 : */
26832 298 : __pyx_t_1 = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_v_wpnorm, (__pyx_v_wnorm * __pyx_v_inv_root2));
26833 298 : if (__pyx_t_1) {
26834 :
26835 : /* "scipy/linalg/_decomp_update.pyx":1182
26836 : *
26837 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
26838 : * scal(m, 0, u, us[0]) # <<<<<<<<<<<<<<
26839 : * axpy(n, 1, s, 1, s+n, 1)
26840 : * scal(n, unorm, s, 1)
26841 : */
26842 1 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, 0.0, __pyx_v_u, (__pyx_v_us[0]));
26843 :
26844 : /* "scipy/linalg/_decomp_update.pyx":1183
26845 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
26846 : * scal(m, 0, u, us[0])
26847 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
26848 : * scal(n, unorm, s, 1)
26849 : * s[n] = 0
26850 : */
26851 1 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
26852 :
26853 : /* "scipy/linalg/_decomp_update.pyx":1184
26854 : * scal(m, 0, u, us[0])
26855 : * axpy(n, 1, s, 1, s+n, 1)
26856 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
26857 : * s[n] = 0
26858 : * return 1
26859 : */
26860 1 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
26861 :
26862 : /* "scipy/linalg/_decomp_update.pyx":1185
26863 : * axpy(n, 1, s, 1, s+n, 1)
26864 : * scal(n, unorm, s, 1)
26865 : * s[n] = 0 # <<<<<<<<<<<<<<
26866 : * return 1
26867 : *
26868 : */
26869 1 : (__pyx_v_s[__pyx_v_n]) = 0.0;
26870 :
26871 : /* "scipy/linalg/_decomp_update.pyx":1186
26872 : * scal(n, unorm, s, 1)
26873 : * s[n] = 0
26874 : * return 1 # <<<<<<<<<<<<<<
26875 : *
26876 : * with cython.cdivision(True):
26877 : */
26878 1 : __pyx_r = 1;
26879 1 : goto __pyx_L0;
26880 :
26881 : /* "scipy/linalg/_decomp_update.pyx":1181
26882 : * wpnorm = nrm2(m, u, us[0])
26883 : *
26884 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
26885 : * scal(m, 0, u, us[0])
26886 : * axpy(n, 1, s, 1, s+n, 1)
26887 : */
26888 : }
26889 :
26890 : /* "scipy/linalg/_decomp_update.pyx":1189
26891 : *
26892 : * with cython.cdivision(True):
26893 : * scal(m, 1/wpnorm, u, us[0]) # <<<<<<<<<<<<<<
26894 : * axpy(n, 1, s, 1, s+n, 1)
26895 : * scal(n, unorm, s, 1)
26896 : */
26897 297 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, (1.0 / __pyx_v_wpnorm), __pyx_v_u, (__pyx_v_us[0]));
26898 :
26899 : /* "scipy/linalg/_decomp_update.pyx":1190
26900 : * with cython.cdivision(True):
26901 : * scal(m, 1/wpnorm, u, us[0])
26902 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
26903 : * scal(n, unorm, s, 1)
26904 : * s[n] = wpnorm*unorm
26905 : */
26906 297 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, 1.0, __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
26907 :
26908 : /* "scipy/linalg/_decomp_update.pyx":1191
26909 : * scal(m, 1/wpnorm, u, us[0])
26910 : * axpy(n, 1, s, 1, s+n, 1)
26911 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
26912 : * s[n] = wpnorm*unorm
26913 : * return 0
26914 : */
26915 297 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
26916 :
26917 : /* "scipy/linalg/_decomp_update.pyx":1192
26918 : * axpy(n, 1, s, 1, s+n, 1)
26919 : * scal(n, unorm, s, 1)
26920 : * s[n] = wpnorm*unorm # <<<<<<<<<<<<<<
26921 : * return 0
26922 : *
26923 : */
26924 297 : (__pyx_v_s[__pyx_v_n]) = (__pyx_v_wpnorm * __pyx_v_unorm);
26925 :
26926 : /* "scipy/linalg/_decomp_update.pyx":1193
26927 : * scal(n, unorm, s, 1)
26928 : * s[n] = wpnorm*unorm
26929 : * return 0 # <<<<<<<<<<<<<<
26930 : *
26931 : * def _form_qTu(object a, object b):
26932 : */
26933 297 : __pyx_r = 0;
26934 297 : goto __pyx_L0;
26935 :
26936 : /* "scipy/linalg/_decomp_update.pyx":1087
26937 : * index2(r, rs, j, j)[0] = rjj
26938 : *
26939 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u, # <<<<<<<<<<<<<<
26940 : * int* us, blas_t* s, blas_t* RCOND) noexcept nogil:
26941 : * """Given a (m,n) matrix q with orthonormal columns and a (m,) vector u,
26942 : */
26943 :
26944 : /* function exit code */
26945 0 : __pyx_L1_error:;
26946 : #ifdef WITH_THREAD
26947 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
26948 : #endif
26949 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorth", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
26950 0 : __pyx_r = 0;
26951 : #ifdef WITH_THREAD
26952 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
26953 : #endif
26954 299 : __pyx_L0:;
26955 299 : return __pyx_r;
26956 : }
26957 :
26958 299 : static int __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int __pyx_v_m, int __pyx_v_n, __pyx_t_float_complex *__pyx_v_q, CYTHON_UNUSED int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_float_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_float_complex *__pyx_v_s, __pyx_t_float_complex *__pyx_v_RCOND) {
26959 299 : __pyx_t_float_complex __pyx_v_unorm;
26960 299 : __pyx_t_float_complex __pyx_v_snorm;
26961 299 : __pyx_t_float_complex __pyx_v_wnorm;
26962 299 : __pyx_t_float_complex __pyx_v_wpnorm;
26963 299 : __pyx_t_float_complex __pyx_v_sigma_max;
26964 299 : __pyx_t_float_complex __pyx_v_sigma_min;
26965 299 : __pyx_t_float_complex __pyx_v_rc;
26966 299 : char *__pyx_v_T;
26967 299 : char *__pyx_v_N;
26968 299 : char *__pyx_v_C;
26969 299 : int __pyx_v_ss;
26970 299 : __pyx_t_float_complex __pyx_v_inv_root2;
26971 299 : int __pyx_r;
26972 299 : __pyx_t_double_complex __pyx_t_1;
26973 299 : __pyx_t_double_complex __pyx_t_2;
26974 299 : __pyx_t_double_complex __pyx_t_3;
26975 299 : int __pyx_t_4;
26976 299 : int __pyx_lineno = 0;
26977 299 : const char *__pyx_filename = NULL;
26978 299 : int __pyx_clineno = 0;
26979 : #ifdef WITH_THREAD
26980 299 : PyGILState_STATE __pyx_gilstate_save;
26981 : #endif
26982 :
26983 : /* "scipy/linalg/_decomp_update.pyx":1104
26984 : * """
26985 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
26986 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
26987 : * cdef char* N = 'N'
26988 : * cdef char* C = 'C'
26989 : */
26990 299 : __pyx_v_T = ((char *)"T");
26991 :
26992 : /* "scipy/linalg/_decomp_update.pyx":1105
26993 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
26994 : * cdef char* T = 'T'
26995 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
26996 : * cdef char* C = 'C'
26997 : * cdef int ss = 1
26998 : */
26999 299 : __pyx_v_N = ((char *)"N");
27000 :
27001 : /* "scipy/linalg/_decomp_update.pyx":1106
27002 : * cdef char* T = 'T'
27003 : * cdef char* N = 'N'
27004 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
27005 : * cdef int ss = 1
27006 : * cdef blas_t inv_root2 = M_SQRT1_2
27007 : */
27008 299 : __pyx_v_C = ((char *)"C");
27009 :
27010 : /* "scipy/linalg/_decomp_update.pyx":1107
27011 : * cdef char* N = 'N'
27012 : * cdef char* C = 'C'
27013 : * cdef int ss = 1 # <<<<<<<<<<<<<<
27014 : * cdef blas_t inv_root2 = M_SQRT1_2
27015 : *
27016 : */
27017 299 : __pyx_v_ss = 1;
27018 :
27019 : /* "scipy/linalg/_decomp_update.pyx":1108
27020 : * cdef char* C = 'C'
27021 : * cdef int ss = 1
27022 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
27023 : *
27024 : * # normalize u
27025 : */
27026 299 : __pyx_v_inv_root2 = __pyx_t_float_complex_from_parts(M_SQRT1_2, 0);
27027 :
27028 : /* "scipy/linalg/_decomp_update.pyx":1111
27029 : *
27030 : * # normalize u
27031 : * unorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
27032 : * scal(m, 1/unorm, u, us[0])
27033 : *
27034 : */
27035 598 : __pyx_v_unorm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
27036 :
27037 : /* "scipy/linalg/_decomp_update.pyx":1112
27038 : * # normalize u
27039 : * unorm = nrm2(m, u, us[0])
27040 : * scal(m, 1/unorm, u, us[0]) # <<<<<<<<<<<<<<
27041 : *
27042 : * # decompose u into q's columns.
27043 : */
27044 299 : __pyx_t_1 = __pyx_t_double_complex_from_parts(1, 0);
27045 299 : __pyx_t_2 = __pyx_t_double_complex_from_parts(__Pyx_CREAL(__pyx_v_unorm), __Pyx_CIMAG(__pyx_v_unorm));
27046 299 : if (unlikely(__Pyx_c_is_zero_double(__pyx_t_2))) {
27047 : #ifdef WITH_THREAD
27048 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27049 : #endif
27050 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
27051 : #ifdef WITH_THREAD
27052 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
27053 : #endif
27054 0 : __PYX_ERR(0, 1112, __pyx_L1_error)
27055 : }
27056 299 : __pyx_t_3 = __Pyx_c_quot_double(__pyx_t_1, __pyx_t_2);
27057 598 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __pyx_t_float_complex_from_parts(__Pyx_CREAL(__pyx_t_3), __Pyx_CIMAG(__pyx_t_3)), __pyx_v_u, (__pyx_v_us[0]));
27058 :
27059 : /* "scipy/linalg/_decomp_update.pyx":1115
27060 : *
27061 : * # decompose u into q's columns.
27062 : * if qisF: # <<<<<<<<<<<<<<
27063 : * if blas_t is float or blas_t is double:
27064 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
27065 : */
27066 299 : if (__pyx_v_qisF) {
27067 :
27068 : /* "scipy/linalg/_decomp_update.pyx":1119
27069 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
27070 : * else:
27071 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
27072 : * else:
27073 : * if blas_t is float or blas_t is double:
27074 : */
27075 546 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(0, 0), __pyx_v_s, 1);
27076 :
27077 : /* "scipy/linalg/_decomp_update.pyx":1115
27078 : *
27079 : * # decompose u into q's columns.
27080 : * if qisF: # <<<<<<<<<<<<<<
27081 : * if blas_t is float or blas_t is double:
27082 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
27083 : */
27084 273 : goto __pyx_L3;
27085 : }
27086 :
27087 : /* "scipy/linalg/_decomp_update.pyx":1121
27088 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1)
27089 : * else:
27090 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
27091 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27092 : * else:
27093 : */
27094 : /*else*/ {
27095 :
27096 : /* "scipy/linalg/_decomp_update.pyx":1124
27097 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27098 : * else:
27099 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27100 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27101 : * blas_t_conj(m, u, us)
27102 : */
27103 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27104 :
27105 : /* "scipy/linalg/_decomp_update.pyx":1125
27106 : * else:
27107 : * blas_t_conj(m, u, us)
27108 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
27109 : * blas_t_conj(m, u, us)
27110 : * blas_t_conj(n, s, &ss)
27111 : */
27112 52 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(0, 0), __pyx_v_s, 1);
27113 :
27114 : /* "scipy/linalg/_decomp_update.pyx":1126
27115 : * blas_t_conj(m, u, us)
27116 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27117 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27118 : * blas_t_conj(n, s, &ss)
27119 : *
27120 : */
27121 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27122 :
27123 : /* "scipy/linalg/_decomp_update.pyx":1127
27124 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27125 : * blas_t_conj(m, u, us)
27126 : * blas_t_conj(n, s, &ss) # <<<<<<<<<<<<<<
27127 : *
27128 : * # sigma_max is the largest singular value of q augmented with u/unorm
27129 : */
27130 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_s, (&__pyx_v_ss));
27131 : }
27132 299 : __pyx_L3:;
27133 :
27134 : /* "scipy/linalg/_decomp_update.pyx":1130
27135 : *
27136 : * # sigma_max is the largest singular value of q augmented with u/unorm
27137 : * snorm = nrm2(n, s, 1) # <<<<<<<<<<<<<<
27138 : * sigma_max = blas_t_sqrt(1 + snorm)
27139 : *
27140 : */
27141 299 : __pyx_v_snorm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_v_s, 1);
27142 :
27143 : /* "scipy/linalg/_decomp_update.pyx":1131
27144 : * # sigma_max is the largest singular value of q augmented with u/unorm
27145 : * snorm = nrm2(n, s, 1)
27146 : * sigma_max = blas_t_sqrt(1 + snorm) # <<<<<<<<<<<<<<
27147 : *
27148 : * # make u be the part of u that is not in span(q)
27149 : */
27150 299 : __pyx_v_sigma_max = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(__Pyx_c_sum_float(__pyx_t_float_complex_from_parts(1, 0), __pyx_v_snorm));
27151 :
27152 : /* "scipy/linalg/_decomp_update.pyx":1135
27153 : * # make u be the part of u that is not in span(q)
27154 : * # i.e. u -= q.dot(s)
27155 : * if qisF: # <<<<<<<<<<<<<<
27156 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
27157 : * else:
27158 : */
27159 299 : if (__pyx_v_qisF) {
27160 :
27161 : /* "scipy/linalg/_decomp_update.pyx":1136
27162 : * # i.e. u -= q.dot(s)
27163 : * if qisF:
27164 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
27165 : * else:
27166 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
27167 : */
27168 546 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_m, __pyx_v_s, 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
27169 :
27170 : /* "scipy/linalg/_decomp_update.pyx":1135
27171 : * # make u be the part of u that is not in span(q)
27172 : * # i.e. u -= q.dot(s)
27173 : * if qisF: # <<<<<<<<<<<<<<
27174 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
27175 : * else:
27176 : */
27177 273 : goto __pyx_L4;
27178 : }
27179 :
27180 : /* "scipy/linalg/_decomp_update.pyx":1138
27181 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
27182 : * else:
27183 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
27184 : * wnorm = nrm2(m, u, us[0])
27185 : *
27186 : */
27187 : /*else*/ {
27188 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
27189 : }
27190 299 : __pyx_L4:;
27191 :
27192 : /* "scipy/linalg/_decomp_update.pyx":1139
27193 : * else:
27194 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
27195 : * wnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
27196 : *
27197 : * # sigma_min is the smallest singular value of q augmented with u/unorm
27198 : */
27199 299 : __pyx_v_wnorm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
27200 :
27201 : /* "scipy/linalg/_decomp_update.pyx":1144
27202 : * # the others are == 1, since q is orthonormal.
27203 : * with cython.cdivision(True):
27204 : * sigma_min = wnorm / sigma_max # <<<<<<<<<<<<<<
27205 : * rc = sigma_min / sigma_max
27206 : *
27207 : */
27208 299 : __pyx_v_sigma_min = __Pyx_c_quot_float(__pyx_v_wnorm, __pyx_v_sigma_max);
27209 :
27210 : /* "scipy/linalg/_decomp_update.pyx":1145
27211 : * with cython.cdivision(True):
27212 : * sigma_min = wnorm / sigma_max
27213 : * rc = sigma_min / sigma_max # <<<<<<<<<<<<<<
27214 : *
27215 : * # check the conditioning of the problem.
27216 : */
27217 299 : __pyx_v_rc = __Pyx_c_quot_float(__pyx_v_sigma_min, __pyx_v_sigma_max);
27218 :
27219 : /* "scipy/linalg/_decomp_update.pyx":1148
27220 : *
27221 : * # check the conditioning of the problem.
27222 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
27223 : * RCOND[0] = rc
27224 : * return 2
27225 : */
27226 299 : __pyx_t_4 = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_rc, (__pyx_v_RCOND[0]));
27227 299 : if (__pyx_t_4) {
27228 :
27229 : /* "scipy/linalg/_decomp_update.pyx":1149
27230 : * # check the conditioning of the problem.
27231 : * if blas_t_less_than(rc, RCOND[0]):
27232 : * RCOND[0] = rc # <<<<<<<<<<<<<<
27233 : * return 2
27234 : * RCOND[0] = rc
27235 : */
27236 1 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
27237 :
27238 : /* "scipy/linalg/_decomp_update.pyx":1150
27239 : * if blas_t_less_than(rc, RCOND[0]):
27240 : * RCOND[0] = rc
27241 : * return 2 # <<<<<<<<<<<<<<
27242 : * RCOND[0] = rc
27243 : *
27244 : */
27245 1 : __pyx_r = 2;
27246 1 : goto __pyx_L0;
27247 :
27248 : /* "scipy/linalg/_decomp_update.pyx":1148
27249 : *
27250 : * # check the conditioning of the problem.
27251 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
27252 : * RCOND[0] = rc
27253 : * return 2
27254 : */
27255 : }
27256 :
27257 : /* "scipy/linalg/_decomp_update.pyx":1151
27258 : * RCOND[0] = rc
27259 : * return 2
27260 : * RCOND[0] = rc # <<<<<<<<<<<<<<
27261 : *
27262 : * if blas_t_less_than(inv_root2, wnorm):
27263 : */
27264 298 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
27265 :
27266 : /* "scipy/linalg/_decomp_update.pyx":1153
27267 : * RCOND[0] = rc
27268 : *
27269 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
27270 : * with cython.cdivision(True):
27271 : * scal(m, 1/wnorm, u, us[0])
27272 : */
27273 298 : __pyx_t_4 = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
27274 298 : if (__pyx_t_4) {
27275 :
27276 : /* "scipy/linalg/_decomp_update.pyx":1155
27277 : * if blas_t_less_than(inv_root2, wnorm):
27278 : * with cython.cdivision(True):
27279 : * scal(m, 1/wnorm, u, us[0]) # <<<<<<<<<<<<<<
27280 : * scal(n, unorm, s, 1)
27281 : * s[n] = unorm*wnorm
27282 : */
27283 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_float(__pyx_t_float_complex_from_parts(1, 0), __pyx_v_wnorm), __pyx_v_u, (__pyx_v_us[0]));
27284 :
27285 : /* "scipy/linalg/_decomp_update.pyx":1156
27286 : * with cython.cdivision(True):
27287 : * scal(m, 1/wnorm, u, us[0])
27288 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
27289 : * s[n] = unorm*wnorm
27290 : * return 0
27291 : */
27292 0 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
27293 :
27294 : /* "scipy/linalg/_decomp_update.pyx":1157
27295 : * scal(m, 1/wnorm, u, us[0])
27296 : * scal(n, unorm, s, 1)
27297 : * s[n] = unorm*wnorm # <<<<<<<<<<<<<<
27298 : * return 0
27299 : *
27300 : */
27301 0 : (__pyx_v_s[__pyx_v_n]) = __Pyx_c_prod_float(__pyx_v_unorm, __pyx_v_wnorm);
27302 :
27303 : /* "scipy/linalg/_decomp_update.pyx":1158
27304 : * scal(n, unorm, s, 1)
27305 : * s[n] = unorm*wnorm
27306 : * return 0 # <<<<<<<<<<<<<<
27307 : *
27308 : * # if we get here, u does not yet contain the orthogonal vector we are
27309 : */
27310 0 : __pyx_r = 0;
27311 0 : goto __pyx_L0;
27312 :
27313 : /* "scipy/linalg/_decomp_update.pyx":1153
27314 : * RCOND[0] = rc
27315 : *
27316 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
27317 : * with cython.cdivision(True):
27318 : * scal(m, 1/wnorm, u, us[0])
27319 : */
27320 : }
27321 :
27322 : /* "scipy/linalg/_decomp_update.pyx":1163
27323 : * # looking for. According to Reichel, one reorthogonalization will always
27324 : * # be enough.
27325 : * if qisF: # <<<<<<<<<<<<<<
27326 : * if blas_t is float or blas_t is double:
27327 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27328 : */
27329 298 : if (__pyx_v_qisF) {
27330 :
27331 : /* "scipy/linalg/_decomp_update.pyx":1167
27332 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27333 : * else:
27334 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
27335 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0])
27336 : * else:
27337 : */
27338 544 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
27339 :
27340 : /* "scipy/linalg/_decomp_update.pyx":1168
27341 : * else:
27342 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27343 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
27344 : * else:
27345 : * if blas_t is float or blas_t is double:
27346 : */
27347 544 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_m, (__pyx_v_s + __pyx_v_n), 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
27348 :
27349 : /* "scipy/linalg/_decomp_update.pyx":1163
27350 : * # looking for. According to Reichel, one reorthogonalization will always
27351 : * # be enough.
27352 : * if qisF: # <<<<<<<<<<<<<<
27353 : * if blas_t is float or blas_t is double:
27354 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27355 : */
27356 272 : goto __pyx_L7;
27357 : }
27358 :
27359 : /* "scipy/linalg/_decomp_update.pyx":1170
27360 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0])
27361 : * else:
27362 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
27363 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27364 : * else:
27365 : */
27366 : /*else*/ {
27367 :
27368 : /* "scipy/linalg/_decomp_update.pyx":1173
27369 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27370 : * else:
27371 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27372 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27373 : * blas_t_conj(m, u, us)
27374 : */
27375 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27376 :
27377 : /* "scipy/linalg/_decomp_update.pyx":1174
27378 : * else:
27379 : * blas_t_conj(m, u, us)
27380 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
27381 : * blas_t_conj(m, u, us)
27382 : * blas_t_conj(n, s+n, &ss)
27383 : */
27384 52 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
27385 :
27386 : /* "scipy/linalg/_decomp_update.pyx":1175
27387 : * blas_t_conj(m, u, us)
27388 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27389 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27390 : * blas_t_conj(n, s+n, &ss)
27391 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
27392 : */
27393 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27394 :
27395 : /* "scipy/linalg/_decomp_update.pyx":1176
27396 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27397 : * blas_t_conj(m, u, us)
27398 : * blas_t_conj(n, s+n, &ss) # <<<<<<<<<<<<<<
27399 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
27400 : *
27401 : */
27402 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, (__pyx_v_s + __pyx_v_n), (&__pyx_v_ss));
27403 :
27404 : /* "scipy/linalg/_decomp_update.pyx":1177
27405 : * blas_t_conj(m, u, us)
27406 : * blas_t_conj(n, s+n, &ss)
27407 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
27408 : *
27409 : * wpnorm = nrm2(m, u, us[0])
27410 : */
27411 26 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_float_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
27412 : }
27413 298 : __pyx_L7:;
27414 :
27415 : /* "scipy/linalg/_decomp_update.pyx":1179
27416 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
27417 : *
27418 : * wpnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
27419 : *
27420 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
27421 : */
27422 298 : __pyx_v_wpnorm = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
27423 :
27424 : /* "scipy/linalg/_decomp_update.pyx":1181
27425 : * wpnorm = nrm2(m, u, us[0])
27426 : *
27427 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
27428 : * scal(m, 0, u, us[0])
27429 : * axpy(n, 1, s, 1, s+n, 1)
27430 : */
27431 298 : __pyx_t_4 = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_v_wpnorm, __Pyx_c_prod_float(__pyx_v_wnorm, __pyx_v_inv_root2));
27432 298 : if (__pyx_t_4) {
27433 :
27434 : /* "scipy/linalg/_decomp_update.pyx":1182
27435 : *
27436 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
27437 : * scal(m, 0, u, us[0]) # <<<<<<<<<<<<<<
27438 : * axpy(n, 1, s, 1, s+n, 1)
27439 : * scal(n, unorm, s, 1)
27440 : */
27441 2 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __pyx_t_float_complex_from_parts(0, 0), __pyx_v_u, (__pyx_v_us[0]));
27442 :
27443 : /* "scipy/linalg/_decomp_update.pyx":1183
27444 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
27445 : * scal(m, 0, u, us[0])
27446 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
27447 : * scal(n, unorm, s, 1)
27448 : * s[n] = 0
27449 : */
27450 2 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
27451 :
27452 : /* "scipy/linalg/_decomp_update.pyx":1184
27453 : * scal(m, 0, u, us[0])
27454 : * axpy(n, 1, s, 1, s+n, 1)
27455 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
27456 : * s[n] = 0
27457 : * return 1
27458 : */
27459 1 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
27460 :
27461 : /* "scipy/linalg/_decomp_update.pyx":1185
27462 : * axpy(n, 1, s, 1, s+n, 1)
27463 : * scal(n, unorm, s, 1)
27464 : * s[n] = 0 # <<<<<<<<<<<<<<
27465 : * return 1
27466 : *
27467 : */
27468 1 : (__pyx_v_s[__pyx_v_n]) = __pyx_t_float_complex_from_parts(0, 0);
27469 :
27470 : /* "scipy/linalg/_decomp_update.pyx":1186
27471 : * scal(n, unorm, s, 1)
27472 : * s[n] = 0
27473 : * return 1 # <<<<<<<<<<<<<<
27474 : *
27475 : * with cython.cdivision(True):
27476 : */
27477 1 : __pyx_r = 1;
27478 1 : goto __pyx_L0;
27479 :
27480 : /* "scipy/linalg/_decomp_update.pyx":1181
27481 : * wpnorm = nrm2(m, u, us[0])
27482 : *
27483 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
27484 : * scal(m, 0, u, us[0])
27485 : * axpy(n, 1, s, 1, s+n, 1)
27486 : */
27487 : }
27488 :
27489 : /* "scipy/linalg/_decomp_update.pyx":1189
27490 : *
27491 : * with cython.cdivision(True):
27492 : * scal(m, 1/wpnorm, u, us[0]) # <<<<<<<<<<<<<<
27493 : * axpy(n, 1, s, 1, s+n, 1)
27494 : * scal(n, unorm, s, 1)
27495 : */
27496 594 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_float(__pyx_t_float_complex_from_parts(1, 0), __pyx_v_wpnorm), __pyx_v_u, (__pyx_v_us[0]));
27497 :
27498 : /* "scipy/linalg/_decomp_update.pyx":1190
27499 : * with cython.cdivision(True):
27500 : * scal(m, 1/wpnorm, u, us[0])
27501 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
27502 : * scal(n, unorm, s, 1)
27503 : * s[n] = wpnorm*unorm
27504 : */
27505 594 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
27506 :
27507 : /* "scipy/linalg/_decomp_update.pyx":1191
27508 : * scal(m, 1/wpnorm, u, us[0])
27509 : * axpy(n, 1, s, 1, s+n, 1)
27510 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
27511 : * s[n] = wpnorm*unorm
27512 : * return 0
27513 : */
27514 297 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
27515 :
27516 : /* "scipy/linalg/_decomp_update.pyx":1192
27517 : * axpy(n, 1, s, 1, s+n, 1)
27518 : * scal(n, unorm, s, 1)
27519 : * s[n] = wpnorm*unorm # <<<<<<<<<<<<<<
27520 : * return 0
27521 : *
27522 : */
27523 297 : (__pyx_v_s[__pyx_v_n]) = __Pyx_c_prod_float(__pyx_v_wpnorm, __pyx_v_unorm);
27524 :
27525 : /* "scipy/linalg/_decomp_update.pyx":1193
27526 : * scal(n, unorm, s, 1)
27527 : * s[n] = wpnorm*unorm
27528 : * return 0 # <<<<<<<<<<<<<<
27529 : *
27530 : * def _form_qTu(object a, object b):
27531 : */
27532 297 : __pyx_r = 0;
27533 297 : goto __pyx_L0;
27534 :
27535 : /* "scipy/linalg/_decomp_update.pyx":1087
27536 : * index2(r, rs, j, j)[0] = rjj
27537 : *
27538 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u, # <<<<<<<<<<<<<<
27539 : * int* us, blas_t* s, blas_t* RCOND) noexcept nogil:
27540 : * """Given a (m,n) matrix q with orthonormal columns and a (m,) vector u,
27541 : */
27542 :
27543 : /* function exit code */
27544 0 : __pyx_L1_error:;
27545 : #ifdef WITH_THREAD
27546 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27547 : #endif
27548 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorth", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
27549 0 : __pyx_r = 0;
27550 : #ifdef WITH_THREAD
27551 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
27552 : #endif
27553 299 : __pyx_L0:;
27554 299 : return __pyx_r;
27555 : }
27556 :
27557 299 : static int __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_reorth(int __pyx_v_m, int __pyx_v_n, __pyx_t_double_complex *__pyx_v_q, CYTHON_UNUSED int *__pyx_v_qs, int __pyx_v_qisF, __pyx_t_double_complex *__pyx_v_u, int *__pyx_v_us, __pyx_t_double_complex *__pyx_v_s, __pyx_t_double_complex *__pyx_v_RCOND) {
27558 299 : __pyx_t_double_complex __pyx_v_unorm;
27559 299 : __pyx_t_double_complex __pyx_v_snorm;
27560 299 : __pyx_t_double_complex __pyx_v_wnorm;
27561 299 : __pyx_t_double_complex __pyx_v_wpnorm;
27562 299 : __pyx_t_double_complex __pyx_v_sigma_max;
27563 299 : __pyx_t_double_complex __pyx_v_sigma_min;
27564 299 : __pyx_t_double_complex __pyx_v_rc;
27565 299 : char *__pyx_v_T;
27566 299 : char *__pyx_v_N;
27567 299 : char *__pyx_v_C;
27568 299 : int __pyx_v_ss;
27569 299 : __pyx_t_double_complex __pyx_v_inv_root2;
27570 299 : int __pyx_r;
27571 299 : __pyx_t_double_complex __pyx_t_1;
27572 299 : int __pyx_t_2;
27573 299 : int __pyx_lineno = 0;
27574 299 : const char *__pyx_filename = NULL;
27575 299 : int __pyx_clineno = 0;
27576 : #ifdef WITH_THREAD
27577 299 : PyGILState_STATE __pyx_gilstate_save;
27578 : #endif
27579 :
27580 : /* "scipy/linalg/_decomp_update.pyx":1104
27581 : * """
27582 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
27583 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
27584 : * cdef char* N = 'N'
27585 : * cdef char* C = 'C'
27586 : */
27587 299 : __pyx_v_T = ((char *)"T");
27588 :
27589 : /* "scipy/linalg/_decomp_update.pyx":1105
27590 : * cdef blas_t unorm, snorm, wnorm, wpnorm, sigma_max, sigma_min, rc
27591 : * cdef char* T = 'T'
27592 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
27593 : * cdef char* C = 'C'
27594 : * cdef int ss = 1
27595 : */
27596 299 : __pyx_v_N = ((char *)"N");
27597 :
27598 : /* "scipy/linalg/_decomp_update.pyx":1106
27599 : * cdef char* T = 'T'
27600 : * cdef char* N = 'N'
27601 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
27602 : * cdef int ss = 1
27603 : * cdef blas_t inv_root2 = M_SQRT1_2
27604 : */
27605 299 : __pyx_v_C = ((char *)"C");
27606 :
27607 : /* "scipy/linalg/_decomp_update.pyx":1107
27608 : * cdef char* N = 'N'
27609 : * cdef char* C = 'C'
27610 : * cdef int ss = 1 # <<<<<<<<<<<<<<
27611 : * cdef blas_t inv_root2 = M_SQRT1_2
27612 : *
27613 : */
27614 299 : __pyx_v_ss = 1;
27615 :
27616 : /* "scipy/linalg/_decomp_update.pyx":1108
27617 : * cdef char* C = 'C'
27618 : * cdef int ss = 1
27619 : * cdef blas_t inv_root2 = M_SQRT1_2 # <<<<<<<<<<<<<<
27620 : *
27621 : * # normalize u
27622 : */
27623 299 : __pyx_v_inv_root2 = __pyx_t_double_complex_from_parts(M_SQRT1_2, 0);
27624 :
27625 : /* "scipy/linalg/_decomp_update.pyx":1111
27626 : *
27627 : * # normalize u
27628 : * unorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
27629 : * scal(m, 1/unorm, u, us[0])
27630 : *
27631 : */
27632 598 : __pyx_v_unorm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
27633 :
27634 : /* "scipy/linalg/_decomp_update.pyx":1112
27635 : * # normalize u
27636 : * unorm = nrm2(m, u, us[0])
27637 : * scal(m, 1/unorm, u, us[0]) # <<<<<<<<<<<<<<
27638 : *
27639 : * # decompose u into q's columns.
27640 : */
27641 299 : __pyx_t_1 = __pyx_t_double_complex_from_parts(1, 0);
27642 299 : if (unlikely(__Pyx_c_is_zero_double(__pyx_v_unorm))) {
27643 : #ifdef WITH_THREAD
27644 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27645 : #endif
27646 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
27647 : #ifdef WITH_THREAD
27648 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
27649 : #endif
27650 0 : __PYX_ERR(0, 1112, __pyx_L1_error)
27651 : }
27652 299 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_double(__pyx_t_1, __pyx_v_unorm), __pyx_v_u, (__pyx_v_us[0]));
27653 :
27654 : /* "scipy/linalg/_decomp_update.pyx":1115
27655 : *
27656 : * # decompose u into q's columns.
27657 : * if qisF: # <<<<<<<<<<<<<<
27658 : * if blas_t is float or blas_t is double:
27659 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
27660 : */
27661 299 : if (__pyx_v_qisF) {
27662 :
27663 : /* "scipy/linalg/_decomp_update.pyx":1119
27664 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
27665 : * else:
27666 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
27667 : * else:
27668 : * if blas_t is float or blas_t is double:
27669 : */
27670 546 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(0, 0), __pyx_v_s, 1);
27671 :
27672 : /* "scipy/linalg/_decomp_update.pyx":1115
27673 : *
27674 : * # decompose u into q's columns.
27675 : * if qisF: # <<<<<<<<<<<<<<
27676 : * if blas_t is float or blas_t is double:
27677 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s, 1)
27678 : */
27679 273 : goto __pyx_L3;
27680 : }
27681 :
27682 : /* "scipy/linalg/_decomp_update.pyx":1121
27683 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s, 1)
27684 : * else:
27685 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
27686 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27687 : * else:
27688 : */
27689 : /*else*/ {
27690 :
27691 : /* "scipy/linalg/_decomp_update.pyx":1124
27692 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27693 : * else:
27694 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27695 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27696 : * blas_t_conj(m, u, us)
27697 : */
27698 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27699 :
27700 : /* "scipy/linalg/_decomp_update.pyx":1125
27701 : * else:
27702 : * blas_t_conj(m, u, us)
27703 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1) # <<<<<<<<<<<<<<
27704 : * blas_t_conj(m, u, us)
27705 : * blas_t_conj(n, s, &ss)
27706 : */
27707 52 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(0, 0), __pyx_v_s, 1);
27708 :
27709 : /* "scipy/linalg/_decomp_update.pyx":1126
27710 : * blas_t_conj(m, u, us)
27711 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27712 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27713 : * blas_t_conj(n, s, &ss)
27714 : *
27715 : */
27716 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27717 :
27718 : /* "scipy/linalg/_decomp_update.pyx":1127
27719 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s, 1)
27720 : * blas_t_conj(m, u, us)
27721 : * blas_t_conj(n, s, &ss) # <<<<<<<<<<<<<<
27722 : *
27723 : * # sigma_max is the largest singular value of q augmented with u/unorm
27724 : */
27725 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, __pyx_v_s, (&__pyx_v_ss));
27726 : }
27727 299 : __pyx_L3:;
27728 :
27729 : /* "scipy/linalg/_decomp_update.pyx":1130
27730 : *
27731 : * # sigma_max is the largest singular value of q augmented with u/unorm
27732 : * snorm = nrm2(n, s, 1) # <<<<<<<<<<<<<<
27733 : * sigma_max = blas_t_sqrt(1 + snorm)
27734 : *
27735 : */
27736 299 : __pyx_v_snorm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_n, __pyx_v_s, 1);
27737 :
27738 : /* "scipy/linalg/_decomp_update.pyx":1131
27739 : * # sigma_max is the largest singular value of q augmented with u/unorm
27740 : * snorm = nrm2(n, s, 1)
27741 : * sigma_max = blas_t_sqrt(1 + snorm) # <<<<<<<<<<<<<<
27742 : *
27743 : * # make u be the part of u that is not in span(q)
27744 : */
27745 299 : __pyx_v_sigma_max = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_sqrt(__Pyx_c_sum_double(__pyx_t_double_complex_from_parts(1, 0), __pyx_v_snorm));
27746 :
27747 : /* "scipy/linalg/_decomp_update.pyx":1135
27748 : * # make u be the part of u that is not in span(q)
27749 : * # i.e. u -= q.dot(s)
27750 : * if qisF: # <<<<<<<<<<<<<<
27751 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
27752 : * else:
27753 : */
27754 299 : if (__pyx_v_qisF) {
27755 :
27756 : /* "scipy/linalg/_decomp_update.pyx":1136
27757 : * # i.e. u -= q.dot(s)
27758 : * if qisF:
27759 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
27760 : * else:
27761 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
27762 : */
27763 546 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_m, __pyx_v_s, 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
27764 :
27765 : /* "scipy/linalg/_decomp_update.pyx":1135
27766 : * # make u be the part of u that is not in span(q)
27767 : * # i.e. u -= q.dot(s)
27768 : * if qisF: # <<<<<<<<<<<<<<
27769 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
27770 : * else:
27771 : */
27772 273 : goto __pyx_L4;
27773 : }
27774 :
27775 : /* "scipy/linalg/_decomp_update.pyx":1138
27776 : * gemv(N, m, n, -1, q, m, s, 1, 1, u, us[0])
27777 : * else:
27778 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
27779 : * wnorm = nrm2(m, u, us[0])
27780 : *
27781 : */
27782 : /*else*/ {
27783 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, __pyx_v_s, 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
27784 : }
27785 299 : __pyx_L4:;
27786 :
27787 : /* "scipy/linalg/_decomp_update.pyx":1139
27788 : * else:
27789 : * gemv(T, n, m, -1, q, n, s, 1, 1, u, us[0])
27790 : * wnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
27791 : *
27792 : * # sigma_min is the smallest singular value of q augmented with u/unorm
27793 : */
27794 299 : __pyx_v_wnorm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
27795 :
27796 : /* "scipy/linalg/_decomp_update.pyx":1144
27797 : * # the others are == 1, since q is orthonormal.
27798 : * with cython.cdivision(True):
27799 : * sigma_min = wnorm / sigma_max # <<<<<<<<<<<<<<
27800 : * rc = sigma_min / sigma_max
27801 : *
27802 : */
27803 299 : __pyx_v_sigma_min = __Pyx_c_quot_double(__pyx_v_wnorm, __pyx_v_sigma_max);
27804 :
27805 : /* "scipy/linalg/_decomp_update.pyx":1145
27806 : * with cython.cdivision(True):
27807 : * sigma_min = wnorm / sigma_max
27808 : * rc = sigma_min / sigma_max # <<<<<<<<<<<<<<
27809 : *
27810 : * # check the conditioning of the problem.
27811 : */
27812 299 : __pyx_v_rc = __Pyx_c_quot_double(__pyx_v_sigma_min, __pyx_v_sigma_max);
27813 :
27814 : /* "scipy/linalg/_decomp_update.pyx":1148
27815 : *
27816 : * # check the conditioning of the problem.
27817 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
27818 : * RCOND[0] = rc
27819 : * return 2
27820 : */
27821 299 : __pyx_t_2 = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_rc, (__pyx_v_RCOND[0]));
27822 299 : if (__pyx_t_2) {
27823 :
27824 : /* "scipy/linalg/_decomp_update.pyx":1149
27825 : * # check the conditioning of the problem.
27826 : * if blas_t_less_than(rc, RCOND[0]):
27827 : * RCOND[0] = rc # <<<<<<<<<<<<<<
27828 : * return 2
27829 : * RCOND[0] = rc
27830 : */
27831 1 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
27832 :
27833 : /* "scipy/linalg/_decomp_update.pyx":1150
27834 : * if blas_t_less_than(rc, RCOND[0]):
27835 : * RCOND[0] = rc
27836 : * return 2 # <<<<<<<<<<<<<<
27837 : * RCOND[0] = rc
27838 : *
27839 : */
27840 1 : __pyx_r = 2;
27841 1 : goto __pyx_L0;
27842 :
27843 : /* "scipy/linalg/_decomp_update.pyx":1148
27844 : *
27845 : * # check the conditioning of the problem.
27846 : * if blas_t_less_than(rc, RCOND[0]): # <<<<<<<<<<<<<<
27847 : * RCOND[0] = rc
27848 : * return 2
27849 : */
27850 : }
27851 :
27852 : /* "scipy/linalg/_decomp_update.pyx":1151
27853 : * RCOND[0] = rc
27854 : * return 2
27855 : * RCOND[0] = rc # <<<<<<<<<<<<<<
27856 : *
27857 : * if blas_t_less_than(inv_root2, wnorm):
27858 : */
27859 298 : (__pyx_v_RCOND[0]) = __pyx_v_rc;
27860 :
27861 : /* "scipy/linalg/_decomp_update.pyx":1153
27862 : * RCOND[0] = rc
27863 : *
27864 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
27865 : * with cython.cdivision(True):
27866 : * scal(m, 1/wnorm, u, us[0])
27867 : */
27868 298 : __pyx_t_2 = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_than(__pyx_v_inv_root2, __pyx_v_wnorm);
27869 298 : if (__pyx_t_2) {
27870 :
27871 : /* "scipy/linalg/_decomp_update.pyx":1155
27872 : * if blas_t_less_than(inv_root2, wnorm):
27873 : * with cython.cdivision(True):
27874 : * scal(m, 1/wnorm, u, us[0]) # <<<<<<<<<<<<<<
27875 : * scal(n, unorm, s, 1)
27876 : * s[n] = unorm*wnorm
27877 : */
27878 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_double(__pyx_t_double_complex_from_parts(1, 0), __pyx_v_wnorm), __pyx_v_u, (__pyx_v_us[0]));
27879 :
27880 : /* "scipy/linalg/_decomp_update.pyx":1156
27881 : * with cython.cdivision(True):
27882 : * scal(m, 1/wnorm, u, us[0])
27883 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
27884 : * s[n] = unorm*wnorm
27885 : * return 0
27886 : */
27887 0 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
27888 :
27889 : /* "scipy/linalg/_decomp_update.pyx":1157
27890 : * scal(m, 1/wnorm, u, us[0])
27891 : * scal(n, unorm, s, 1)
27892 : * s[n] = unorm*wnorm # <<<<<<<<<<<<<<
27893 : * return 0
27894 : *
27895 : */
27896 0 : (__pyx_v_s[__pyx_v_n]) = __Pyx_c_prod_double(__pyx_v_unorm, __pyx_v_wnorm);
27897 :
27898 : /* "scipy/linalg/_decomp_update.pyx":1158
27899 : * scal(n, unorm, s, 1)
27900 : * s[n] = unorm*wnorm
27901 : * return 0 # <<<<<<<<<<<<<<
27902 : *
27903 : * # if we get here, u does not yet contain the orthogonal vector we are
27904 : */
27905 0 : __pyx_r = 0;
27906 0 : goto __pyx_L0;
27907 :
27908 : /* "scipy/linalg/_decomp_update.pyx":1153
27909 : * RCOND[0] = rc
27910 : *
27911 : * if blas_t_less_than(inv_root2, wnorm): # <<<<<<<<<<<<<<
27912 : * with cython.cdivision(True):
27913 : * scal(m, 1/wnorm, u, us[0])
27914 : */
27915 : }
27916 :
27917 : /* "scipy/linalg/_decomp_update.pyx":1163
27918 : * # looking for. According to Reichel, one reorthogonalization will always
27919 : * # be enough.
27920 : * if qisF: # <<<<<<<<<<<<<<
27921 : * if blas_t is float or blas_t is double:
27922 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27923 : */
27924 298 : if (__pyx_v_qisF) {
27925 :
27926 : /* "scipy/linalg/_decomp_update.pyx":1167
27927 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27928 : * else:
27929 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
27930 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0])
27931 : * else:
27932 : */
27933 544 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_m, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
27934 :
27935 : /* "scipy/linalg/_decomp_update.pyx":1168
27936 : * else:
27937 : * gemv(C, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27938 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
27939 : * else:
27940 : * if blas_t is float or blas_t is double:
27941 : */
27942 544 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_m, (__pyx_v_s + __pyx_v_n), 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
27943 :
27944 : /* "scipy/linalg/_decomp_update.pyx":1163
27945 : * # looking for. According to Reichel, one reorthogonalization will always
27946 : * # be enough.
27947 : * if qisF: # <<<<<<<<<<<<<<
27948 : * if blas_t is float or blas_t is double:
27949 : * gemv(T, m, n, 1, q, m, u, us[0], 0, s+n, 1)
27950 : */
27951 272 : goto __pyx_L7;
27952 : }
27953 :
27954 : /* "scipy/linalg/_decomp_update.pyx":1170
27955 : * gemv(N, m, n, -1, q, m, s+n, 1, 1, u, us[0])
27956 : * else:
27957 : * if blas_t is float or blas_t is double: # <<<<<<<<<<<<<<
27958 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27959 : * else:
27960 : */
27961 : /*else*/ {
27962 :
27963 : /* "scipy/linalg/_decomp_update.pyx":1173
27964 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27965 : * else:
27966 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27967 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27968 : * blas_t_conj(m, u, us)
27969 : */
27970 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27971 :
27972 : /* "scipy/linalg/_decomp_update.pyx":1174
27973 : * else:
27974 : * blas_t_conj(m, u, us)
27975 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1) # <<<<<<<<<<<<<<
27976 : * blas_t_conj(m, u, us)
27977 : * blas_t_conj(n, s+n, &ss)
27978 : */
27979 52 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_n, __pyx_v_m, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_q, __pyx_v_n, __pyx_v_u, (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(0, 0), (__pyx_v_s + __pyx_v_n), 1);
27980 :
27981 : /* "scipy/linalg/_decomp_update.pyx":1175
27982 : * blas_t_conj(m, u, us)
27983 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27984 : * blas_t_conj(m, u, us) # <<<<<<<<<<<<<<
27985 : * blas_t_conj(n, s+n, &ss)
27986 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
27987 : */
27988 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_v_u, __pyx_v_us);
27989 :
27990 : /* "scipy/linalg/_decomp_update.pyx":1176
27991 : * gemv(N, n, m, 1, q, n, u, us[0], 0, s+n, 1)
27992 : * blas_t_conj(m, u, us)
27993 : * blas_t_conj(n, s+n, &ss) # <<<<<<<<<<<<<<
27994 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
27995 : *
27996 : */
27997 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_n, (__pyx_v_s + __pyx_v_n), (&__pyx_v_ss));
27998 :
27999 : /* "scipy/linalg/_decomp_update.pyx":1177
28000 : * blas_t_conj(m, u, us)
28001 : * blas_t_conj(n, s+n, &ss)
28002 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0]) # <<<<<<<<<<<<<<
28003 : *
28004 : * wpnorm = nrm2(m, u, us[0])
28005 : */
28006 26 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_n, __pyx_v_m, __pyx_t_double_complex_from_parts(-1L, 0), __pyx_v_q, __pyx_v_n, (__pyx_v_s + __pyx_v_n), 1, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_u, (__pyx_v_us[0]));
28007 : }
28008 298 : __pyx_L7:;
28009 :
28010 : /* "scipy/linalg/_decomp_update.pyx":1179
28011 : * gemv(T, n, m, -1, q, n, s+n, 1, 1, u, us[0])
28012 : *
28013 : * wpnorm = nrm2(m, u, us[0]) # <<<<<<<<<<<<<<
28014 : *
28015 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
28016 : */
28017 298 : __pyx_v_wpnorm = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_nrm2(__pyx_v_m, __pyx_v_u, (__pyx_v_us[0]));
28018 :
28019 : /* "scipy/linalg/_decomp_update.pyx":1181
28020 : * wpnorm = nrm2(m, u, us[0])
28021 : *
28022 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
28023 : * scal(m, 0, u, us[0])
28024 : * axpy(n, 1, s, 1, s+n, 1)
28025 : */
28026 298 : __pyx_t_2 = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_less_equal(__pyx_v_wpnorm, __Pyx_c_prod_double(__pyx_v_wnorm, __pyx_v_inv_root2));
28027 298 : if (__pyx_t_2) {
28028 :
28029 : /* "scipy/linalg/_decomp_update.pyx":1182
28030 : *
28031 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
28032 : * scal(m, 0, u, us[0]) # <<<<<<<<<<<<<<
28033 : * axpy(n, 1, s, 1, s+n, 1)
28034 : * scal(n, unorm, s, 1)
28035 : */
28036 2 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __pyx_t_double_complex_from_parts(0, 0), __pyx_v_u, (__pyx_v_us[0]));
28037 :
28038 : /* "scipy/linalg/_decomp_update.pyx":1183
28039 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q)
28040 : * scal(m, 0, u, us[0])
28041 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
28042 : * scal(n, unorm, s, 1)
28043 : * s[n] = 0
28044 : */
28045 2 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
28046 :
28047 : /* "scipy/linalg/_decomp_update.pyx":1184
28048 : * scal(m, 0, u, us[0])
28049 : * axpy(n, 1, s, 1, s+n, 1)
28050 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
28051 : * s[n] = 0
28052 : * return 1
28053 : */
28054 1 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
28055 :
28056 : /* "scipy/linalg/_decomp_update.pyx":1185
28057 : * axpy(n, 1, s, 1, s+n, 1)
28058 : * scal(n, unorm, s, 1)
28059 : * s[n] = 0 # <<<<<<<<<<<<<<
28060 : * return 1
28061 : *
28062 : */
28063 1 : (__pyx_v_s[__pyx_v_n]) = __pyx_t_double_complex_from_parts(0, 0);
28064 :
28065 : /* "scipy/linalg/_decomp_update.pyx":1186
28066 : * scal(n, unorm, s, 1)
28067 : * s[n] = 0
28068 : * return 1 # <<<<<<<<<<<<<<
28069 : *
28070 : * with cython.cdivision(True):
28071 : */
28072 1 : __pyx_r = 1;
28073 1 : goto __pyx_L0;
28074 :
28075 : /* "scipy/linalg/_decomp_update.pyx":1181
28076 : * wpnorm = nrm2(m, u, us[0])
28077 : *
28078 : * if blas_t_less_equal(wpnorm, wnorm*inv_root2): # u lies in span(q) # <<<<<<<<<<<<<<
28079 : * scal(m, 0, u, us[0])
28080 : * axpy(n, 1, s, 1, s+n, 1)
28081 : */
28082 : }
28083 :
28084 : /* "scipy/linalg/_decomp_update.pyx":1189
28085 : *
28086 : * with cython.cdivision(True):
28087 : * scal(m, 1/wpnorm, u, us[0]) # <<<<<<<<<<<<<<
28088 : * axpy(n, 1, s, 1, s+n, 1)
28089 : * scal(n, unorm, s, 1)
28090 : */
28091 594 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_m, __Pyx_c_quot_double(__pyx_t_double_complex_from_parts(1, 0), __pyx_v_wpnorm), __pyx_v_u, (__pyx_v_us[0]));
28092 :
28093 : /* "scipy/linalg/_decomp_update.pyx":1190
28094 : * with cython.cdivision(True):
28095 : * scal(m, 1/wpnorm, u, us[0])
28096 : * axpy(n, 1, s, 1, s+n, 1) # <<<<<<<<<<<<<<
28097 : * scal(n, unorm, s, 1)
28098 : * s[n] = wpnorm*unorm
28099 : */
28100 594 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_axpy(__pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), __pyx_v_s, 1, (__pyx_v_s + __pyx_v_n), 1);
28101 :
28102 : /* "scipy/linalg/_decomp_update.pyx":1191
28103 : * scal(m, 1/wpnorm, u, us[0])
28104 : * axpy(n, 1, s, 1, s+n, 1)
28105 : * scal(n, unorm, s, 1) # <<<<<<<<<<<<<<
28106 : * s[n] = wpnorm*unorm
28107 : * return 0
28108 : */
28109 297 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_scal(__pyx_v_n, __pyx_v_unorm, __pyx_v_s, 1);
28110 :
28111 : /* "scipy/linalg/_decomp_update.pyx":1192
28112 : * axpy(n, 1, s, 1, s+n, 1)
28113 : * scal(n, unorm, s, 1)
28114 : * s[n] = wpnorm*unorm # <<<<<<<<<<<<<<
28115 : * return 0
28116 : *
28117 : */
28118 297 : (__pyx_v_s[__pyx_v_n]) = __Pyx_c_prod_double(__pyx_v_wpnorm, __pyx_v_unorm);
28119 :
28120 : /* "scipy/linalg/_decomp_update.pyx":1193
28121 : * scal(n, unorm, s, 1)
28122 : * s[n] = wpnorm*unorm
28123 : * return 0 # <<<<<<<<<<<<<<
28124 : *
28125 : * def _form_qTu(object a, object b):
28126 : */
28127 297 : __pyx_r = 0;
28128 297 : goto __pyx_L0;
28129 :
28130 : /* "scipy/linalg/_decomp_update.pyx":1087
28131 : * index2(r, rs, j, j)[0] = rjj
28132 : *
28133 : * cdef int reorth(int m, int n, blas_t* q, int* qs, bint qisF, blas_t* u, # <<<<<<<<<<<<<<
28134 : * int* us, blas_t* s, blas_t* RCOND) noexcept nogil:
28135 : * """Given a (m,n) matrix q with orthonormal columns and a (m,) vector u,
28136 : */
28137 :
28138 : /* function exit code */
28139 0 : __pyx_L1_error:;
28140 : #ifdef WITH_THREAD
28141 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28142 : #endif
28143 0 : __Pyx_WriteUnraisable("scipy.linalg._decomp_update.reorth", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
28144 0 : __pyx_r = 0;
28145 : #ifdef WITH_THREAD
28146 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
28147 : #endif
28148 299 : __pyx_L0:;
28149 299 : return __pyx_r;
28150 : }
28151 :
28152 : /* "scipy/linalg/_decomp_update.pyx":1195
28153 : * return 0
28154 : *
28155 : * def _form_qTu(object a, object b): # <<<<<<<<<<<<<<
28156 : * """ this function only exists to expose the cdef version below for testing
28157 : * purposes. Here we perform minimal input validation to ensure that the
28158 : */
28159 :
28160 : /* Python wrapper */
28161 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_1_form_qTu(PyObject *__pyx_self,
28162 : #if CYTHON_METH_FASTCALL
28163 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
28164 : #else
28165 : PyObject *__pyx_args, PyObject *__pyx_kwds
28166 : #endif
28167 : ); /*proto*/
28168 : PyDoc_STRVAR(__pyx_doc_5scipy_6linalg_14_decomp_update__form_qTu, " this function only exists to expose the cdef version below for testing\n purposes. Here we perform minimal input validation to ensure that the\n inputs meet the requirements below.\n ");
28169 : static PyMethodDef __pyx_mdef_5scipy_6linalg_14_decomp_update_1_form_qTu = {"_form_qTu", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_14_decomp_update_1_form_qTu, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6linalg_14_decomp_update__form_qTu};
28170 72 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_1_form_qTu(PyObject *__pyx_self,
28171 : #if CYTHON_METH_FASTCALL
28172 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
28173 : #else
28174 : PyObject *__pyx_args, PyObject *__pyx_kwds
28175 : #endif
28176 : ) {
28177 72 : PyObject *__pyx_v_a = 0;
28178 72 : PyObject *__pyx_v_b = 0;
28179 : #if !CYTHON_METH_FASTCALL
28180 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
28181 : #endif
28182 72 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
28183 72 : PyObject* values[2] = {0,0};
28184 72 : int __pyx_lineno = 0;
28185 72 : const char *__pyx_filename = NULL;
28186 72 : int __pyx_clineno = 0;
28187 72 : PyObject *__pyx_r = 0;
28188 : __Pyx_RefNannyDeclarations
28189 72 : __Pyx_RefNannySetupContext("_form_qTu (wrapper)", 0);
28190 : #if !CYTHON_METH_FASTCALL
28191 : #if CYTHON_ASSUME_SAFE_MACROS
28192 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
28193 : #else
28194 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
28195 : #endif
28196 : #endif
28197 72 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
28198 : {
28199 72 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
28200 72 : if (__pyx_kwds) {
28201 0 : Py_ssize_t kw_args;
28202 0 : switch (__pyx_nargs) {
28203 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
28204 0 : CYTHON_FALLTHROUGH;
28205 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
28206 0 : CYTHON_FALLTHROUGH;
28207 0 : case 0: break;
28208 0 : default: goto __pyx_L5_argtuple_error;
28209 : }
28210 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
28211 0 : switch (__pyx_nargs) {
28212 : case 0:
28213 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
28214 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
28215 0 : kw_args--;
28216 : }
28217 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L3_error)
28218 0 : else goto __pyx_L5_argtuple_error;
28219 0 : CYTHON_FALLTHROUGH;
28220 : case 1:
28221 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) {
28222 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
28223 0 : kw_args--;
28224 : }
28225 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L3_error)
28226 : else {
28227 0 : __Pyx_RaiseArgtupleInvalid("_form_qTu", 1, 2, 2, 1); __PYX_ERR(0, 1195, __pyx_L3_error)
28228 : }
28229 : }
28230 0 : if (unlikely(kw_args > 0)) {
28231 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
28232 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_form_qTu") < 0)) __PYX_ERR(0, 1195, __pyx_L3_error)
28233 : }
28234 72 : } else if (unlikely(__pyx_nargs != 2)) {
28235 0 : goto __pyx_L5_argtuple_error;
28236 : } else {
28237 72 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
28238 72 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
28239 : }
28240 72 : __pyx_v_a = values[0];
28241 72 : __pyx_v_b = values[1];
28242 : }
28243 72 : goto __pyx_L6_skip;
28244 0 : __pyx_L5_argtuple_error:;
28245 0 : __Pyx_RaiseArgtupleInvalid("_form_qTu", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1195, __pyx_L3_error)
28246 72 : __pyx_L6_skip:;
28247 72 : goto __pyx_L4_argument_unpacking_done;
28248 0 : __pyx_L3_error:;
28249 : {
28250 0 : Py_ssize_t __pyx_temp;
28251 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
28252 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
28253 : }
28254 : }
28255 0 : __Pyx_AddTraceback("scipy.linalg._decomp_update._form_qTu", __pyx_clineno, __pyx_lineno, __pyx_filename);
28256 0 : __Pyx_RefNannyFinishContext();
28257 0 : return NULL;
28258 72 : __pyx_L4_argument_unpacking_done:;
28259 72 : __pyx_r = __pyx_pf_5scipy_6linalg_14_decomp_update__form_qTu(__pyx_self, __pyx_v_a, __pyx_v_b);
28260 :
28261 : /* function exit code */
28262 : {
28263 72 : Py_ssize_t __pyx_temp;
28264 72 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
28265 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
28266 : }
28267 : }
28268 : __Pyx_RefNannyFinishContext();
28269 : return __pyx_r;
28270 : }
28271 :
28272 72 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update__form_qTu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
28273 72 : PyArrayObject *__pyx_v_q = 0;
28274 72 : PyArrayObject *__pyx_v_u = 0;
28275 72 : PyArrayObject *__pyx_v_qTu = 0;
28276 72 : int __pyx_v_typecode;
28277 72 : void *__pyx_v_qTuvoid;
28278 72 : int __pyx_v_qTus[2];
28279 72 : PyObject *__pyx_r = NULL;
28280 : __Pyx_RefNannyDeclarations
28281 72 : int __pyx_t_1;
28282 72 : int __pyx_t_2;
28283 72 : PyObject *__pyx_t_3 = NULL;
28284 72 : int __pyx_lineno = 0;
28285 72 : const char *__pyx_filename = NULL;
28286 72 : int __pyx_clineno = 0;
28287 72 : __Pyx_RefNannySetupContext("_form_qTu", 1);
28288 :
28289 : /* "scipy/linalg/_decomp_update.pyx":1205
28290 : * cdef int qTus[2]
28291 : *
28292 : * if not cnp.PyArray_Check(a) or not cnp.PyArray_Check(b): # <<<<<<<<<<<<<<
28293 : * raise ValueError('Inputs must be arrays')
28294 : *
28295 : */
28296 72 : __pyx_t_2 = (!PyArray_Check(__pyx_v_a));
28297 72 : if (!__pyx_t_2) {
28298 72 : } else {
28299 0 : __pyx_t_1 = __pyx_t_2;
28300 0 : goto __pyx_L4_bool_binop_done;
28301 : }
28302 72 : __pyx_t_2 = (!PyArray_Check(__pyx_v_b));
28303 72 : __pyx_t_1 = __pyx_t_2;
28304 72 : __pyx_L4_bool_binop_done:;
28305 72 : if (unlikely(__pyx_t_1)) {
28306 :
28307 : /* "scipy/linalg/_decomp_update.pyx":1206
28308 : *
28309 : * if not cnp.PyArray_Check(a) or not cnp.PyArray_Check(b):
28310 : * raise ValueError('Inputs must be arrays') # <<<<<<<<<<<<<<
28311 : *
28312 : * q = a
28313 : */
28314 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error)
28315 0 : __Pyx_GOTREF(__pyx_t_3);
28316 0 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
28317 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28318 0 : __PYX_ERR(0, 1206, __pyx_L1_error)
28319 :
28320 : /* "scipy/linalg/_decomp_update.pyx":1205
28321 : * cdef int qTus[2]
28322 : *
28323 : * if not cnp.PyArray_Check(a) or not cnp.PyArray_Check(b): # <<<<<<<<<<<<<<
28324 : * raise ValueError('Inputs must be arrays')
28325 : *
28326 : */
28327 : }
28328 :
28329 : /* "scipy/linalg/_decomp_update.pyx":1208
28330 : * raise ValueError('Inputs must be arrays')
28331 : *
28332 : * q = a # <<<<<<<<<<<<<<
28333 : * u = b
28334 : *
28335 : */
28336 72 : if (!(likely(((__pyx_v_a) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_a, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1208, __pyx_L1_error)
28337 72 : __pyx_t_3 = __pyx_v_a;
28338 72 : __Pyx_INCREF(__pyx_t_3);
28339 72 : __pyx_v_q = ((PyArrayObject *)__pyx_t_3);
28340 72 : __pyx_t_3 = 0;
28341 :
28342 : /* "scipy/linalg/_decomp_update.pyx":1209
28343 : *
28344 : * q = a
28345 : * u = b # <<<<<<<<<<<<<<
28346 : *
28347 : * typecode = cnp.PyArray_TYPE(q)
28348 : */
28349 72 : if (!(likely(((__pyx_v_b) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_b, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1209, __pyx_L1_error)
28350 72 : __pyx_t_3 = __pyx_v_b;
28351 72 : __Pyx_INCREF(__pyx_t_3);
28352 72 : __pyx_v_u = ((PyArrayObject *)__pyx_t_3);
28353 72 : __pyx_t_3 = 0;
28354 :
28355 : /* "scipy/linalg/_decomp_update.pyx":1211
28356 : * u = b
28357 : *
28358 : * typecode = cnp.PyArray_TYPE(q) # <<<<<<<<<<<<<<
28359 : * if cnp.PyArray_TYPE(u) != typecode:
28360 : * raise ValueError('q and u must have the same type.')
28361 : */
28362 72 : __pyx_v_typecode = PyArray_TYPE(__pyx_v_q);
28363 :
28364 : /* "scipy/linalg/_decomp_update.pyx":1212
28365 : *
28366 : * typecode = cnp.PyArray_TYPE(q)
28367 : * if cnp.PyArray_TYPE(u) != typecode: # <<<<<<<<<<<<<<
28368 : * raise ValueError('q and u must have the same type.')
28369 : *
28370 : */
28371 72 : __pyx_t_1 = (PyArray_TYPE(__pyx_v_u) != __pyx_v_typecode);
28372 72 : if (unlikely(__pyx_t_1)) {
28373 :
28374 : /* "scipy/linalg/_decomp_update.pyx":1213
28375 : * typecode = cnp.PyArray_TYPE(q)
28376 : * if cnp.PyArray_TYPE(u) != typecode:
28377 : * raise ValueError('q and u must have the same type.') # <<<<<<<<<<<<<<
28378 : *
28379 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \
28380 : */
28381 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error)
28382 0 : __Pyx_GOTREF(__pyx_t_3);
28383 0 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
28384 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28385 0 : __PYX_ERR(0, 1213, __pyx_L1_error)
28386 :
28387 : /* "scipy/linalg/_decomp_update.pyx":1212
28388 : *
28389 : * typecode = cnp.PyArray_TYPE(q)
28390 : * if cnp.PyArray_TYPE(u) != typecode: # <<<<<<<<<<<<<<
28391 : * raise ValueError('q and u must have the same type.')
28392 : *
28393 : */
28394 : }
28395 :
28396 : /* "scipy/linalg/_decomp_update.pyx":1215
28397 : * raise ValueError('q and u must have the same type.')
28398 : *
28399 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \ # <<<<<<<<<<<<<<
28400 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
28401 : * raise ValueError('q and u must be a blas compatible type: f d F or D')
28402 : */
28403 72 : switch (__pyx_v_typecode) {
28404 : case NPY_FLOAT:
28405 : case NPY_DOUBLE:
28406 : case NPY_CFLOAT:
28407 :
28408 : /* "scipy/linalg/_decomp_update.pyx":1216
28409 : *
28410 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \
28411 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE): # <<<<<<<<<<<<<<
28412 : * raise ValueError('q and u must be a blas compatible type: f d F or D')
28413 : *
28414 : */
28415 : case NPY_CDOUBLE:
28416 :
28417 : /* "scipy/linalg/_decomp_update.pyx":1215
28418 : * raise ValueError('q and u must have the same type.')
28419 : *
28420 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \ # <<<<<<<<<<<<<<
28421 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
28422 : * raise ValueError('q and u must be a blas compatible type: f d F or D')
28423 : */
28424 : __pyx_t_1 = 1;
28425 : break;
28426 0 : default:
28427 0 : __pyx_t_1 = 0;
28428 0 : break;
28429 : }
28430 72 : __pyx_t_2 = (!__pyx_t_1);
28431 72 : if (unlikely(__pyx_t_2)) {
28432 :
28433 : /* "scipy/linalg/_decomp_update.pyx":1217
28434 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \
28435 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
28436 : * raise ValueError('q and u must be a blas compatible type: f d F or D') # <<<<<<<<<<<<<<
28437 : *
28438 : * q = validate_array(q, True)
28439 : */
28440 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1217, __pyx_L1_error)
28441 0 : __Pyx_GOTREF(__pyx_t_3);
28442 0 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
28443 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28444 0 : __PYX_ERR(0, 1217, __pyx_L1_error)
28445 :
28446 : /* "scipy/linalg/_decomp_update.pyx":1215
28447 : * raise ValueError('q and u must have the same type.')
28448 : *
28449 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \ # <<<<<<<<<<<<<<
28450 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
28451 : * raise ValueError('q and u must be a blas compatible type: f d F or D')
28452 : */
28453 : }
28454 :
28455 : /* "scipy/linalg/_decomp_update.pyx":1219
28456 : * raise ValueError('q and u must be a blas compatible type: f d F or D')
28457 : *
28458 : * q = validate_array(q, True) # <<<<<<<<<<<<<<
28459 : * u = validate_array(u, True)
28460 : *
28461 : */
28462 72 : __pyx_t_3 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_q, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error)
28463 72 : __Pyx_GOTREF(__pyx_t_3);
28464 72 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1219, __pyx_L1_error)
28465 72 : __Pyx_DECREF_SET(__pyx_v_q, ((PyArrayObject *)__pyx_t_3));
28466 72 : __pyx_t_3 = 0;
28467 :
28468 : /* "scipy/linalg/_decomp_update.pyx":1220
28469 : *
28470 : * q = validate_array(q, True)
28471 : * u = validate_array(u, True) # <<<<<<<<<<<<<<
28472 : *
28473 : * qTu = cnp.PyArray_ZEROS(u.ndim, u.shape, typecode, 1)
28474 : */
28475 72 : __pyx_t_3 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_u, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error)
28476 72 : __Pyx_GOTREF(__pyx_t_3);
28477 72 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1220, __pyx_L1_error)
28478 72 : __Pyx_DECREF_SET(__pyx_v_u, ((PyArrayObject *)__pyx_t_3));
28479 72 : __pyx_t_3 = 0;
28480 :
28481 : /* "scipy/linalg/_decomp_update.pyx":1222
28482 : * u = validate_array(u, True)
28483 : *
28484 : * qTu = cnp.PyArray_ZEROS(u.ndim, u.shape, typecode, 1) # <<<<<<<<<<<<<<
28485 : * qTuvoid = extract(qTu, qTus)
28486 : * form_qTu(q, u, qTuvoid, qTus, 0)
28487 : */
28488 72 : __pyx_t_3 = PyArray_ZEROS(__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u), __pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u), __pyx_v_typecode, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error)
28489 72 : __Pyx_GOTREF(__pyx_t_3);
28490 72 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1222, __pyx_L1_error)
28491 72 : __pyx_v_qTu = ((PyArrayObject *)__pyx_t_3);
28492 72 : __pyx_t_3 = 0;
28493 :
28494 : /* "scipy/linalg/_decomp_update.pyx":1223
28495 : *
28496 : * qTu = cnp.PyArray_ZEROS(u.ndim, u.shape, typecode, 1)
28497 : * qTuvoid = extract(qTu, qTus) # <<<<<<<<<<<<<<
28498 : * form_qTu(q, u, qTuvoid, qTus, 0)
28499 : * return qTu
28500 : */
28501 72 : __pyx_v_qTuvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_qTu, __pyx_v_qTus);
28502 :
28503 : /* "scipy/linalg/_decomp_update.pyx":1224
28504 : * qTu = cnp.PyArray_ZEROS(u.ndim, u.shape, typecode, 1)
28505 : * qTuvoid = extract(qTu, qTus)
28506 : * form_qTu(q, u, qTuvoid, qTus, 0) # <<<<<<<<<<<<<<
28507 : * return qTu
28508 : *
28509 : */
28510 72 : __pyx_t_3 = __pyx_f_5scipy_6linalg_14_decomp_update_form_qTu(__pyx_v_q, __pyx_v_u, __pyx_v_qTuvoid, __pyx_v_qTus, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error)
28511 72 : __Pyx_GOTREF(__pyx_t_3);
28512 72 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28513 :
28514 : /* "scipy/linalg/_decomp_update.pyx":1225
28515 : * qTuvoid = extract(qTu, qTus)
28516 : * form_qTu(q, u, qTuvoid, qTus, 0)
28517 : * return qTu # <<<<<<<<<<<<<<
28518 : *
28519 : * cdef form_qTu(cnp.ndarray q, cnp.ndarray u, void* qTuvoid, int* qTus, int k):
28520 : */
28521 72 : __Pyx_XDECREF(__pyx_r);
28522 72 : __Pyx_INCREF((PyObject *)__pyx_v_qTu);
28523 72 : __pyx_r = ((PyObject *)__pyx_v_qTu);
28524 72 : goto __pyx_L0;
28525 :
28526 : /* "scipy/linalg/_decomp_update.pyx":1195
28527 : * return 0
28528 : *
28529 : * def _form_qTu(object a, object b): # <<<<<<<<<<<<<<
28530 : * """ this function only exists to expose the cdef version below for testing
28531 : * purposes. Here we perform minimal input validation to ensure that the
28532 : */
28533 :
28534 : /* function exit code */
28535 0 : __pyx_L1_error:;
28536 0 : __Pyx_XDECREF(__pyx_t_3);
28537 0 : __Pyx_AddTraceback("scipy.linalg._decomp_update._form_qTu", __pyx_clineno, __pyx_lineno, __pyx_filename);
28538 0 : __pyx_r = NULL;
28539 72 : __pyx_L0:;
28540 72 : __Pyx_XDECREF((PyObject *)__pyx_v_q);
28541 72 : __Pyx_XDECREF((PyObject *)__pyx_v_u);
28542 72 : __Pyx_XDECREF((PyObject *)__pyx_v_qTu);
28543 72 : __Pyx_XGIVEREF(__pyx_r);
28544 72 : __Pyx_RefNannyFinishContext();
28545 72 : return __pyx_r;
28546 : }
28547 :
28548 : /* "scipy/linalg/_decomp_update.pyx":1227
28549 : * return qTu
28550 : *
28551 : * cdef form_qTu(cnp.ndarray q, cnp.ndarray u, void* qTuvoid, int* qTus, int k): # <<<<<<<<<<<<<<
28552 : * """ assuming here that q and u have compatible shapes, and are the same
28553 : * type + Q is contiguous. This function is preferable over simply
28554 : */
28555 :
28556 19666 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_form_qTu(PyArrayObject *__pyx_v_q, PyArrayObject *__pyx_v_u, void *__pyx_v_qTuvoid, int *__pyx_v_qTus, int __pyx_v_k) {
28557 19666 : int __pyx_v_m;
28558 19666 : int __pyx_v_n;
28559 19666 : int __pyx_v_typecode;
28560 19666 : char *__pyx_v_T;
28561 19666 : char *__pyx_v_C;
28562 19666 : char *__pyx_v_N;
28563 19666 : void *__pyx_v_qvoid;
28564 19666 : void *__pyx_v_uvoid;
28565 19666 : int __pyx_v_qs[2];
28566 19666 : int __pyx_v_us[2];
28567 19666 : int __pyx_v_ldu;
28568 19666 : int __pyx_v_p;
28569 19666 : char *__pyx_v_utrans;
28570 19666 : PyObject *__pyx_r = NULL;
28571 : __Pyx_RefNannyDeclarations
28572 19666 : int __pyx_t_1;
28573 19666 : PyObject *__pyx_t_2 = NULL;
28574 19666 : int __pyx_lineno = 0;
28575 19666 : const char *__pyx_filename = NULL;
28576 19666 : int __pyx_clineno = 0;
28577 19666 : __Pyx_RefNannySetupContext("form_qTu", 0);
28578 19666 : __Pyx_INCREF((PyObject *)__pyx_v_u);
28579 :
28580 : /* "scipy/linalg/_decomp_update.pyx":1237
28581 : * hold the matrix product of q.T.conj() and u.
28582 : * """
28583 : * cdef int m = q.shape[0] # <<<<<<<<<<<<<<
28584 : * cdef int n = q.shape[1]
28585 : * cdef int typecode = cnp.PyArray_TYPE(q)
28586 : */
28587 19666 : __pyx_v_m = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_q)[0]);
28588 :
28589 : /* "scipy/linalg/_decomp_update.pyx":1238
28590 : * """
28591 : * cdef int m = q.shape[0]
28592 : * cdef int n = q.shape[1] # <<<<<<<<<<<<<<
28593 : * cdef int typecode = cnp.PyArray_TYPE(q)
28594 : * cdef cnp.ndarray qTu
28595 : */
28596 19666 : __pyx_v_n = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_q)[1]);
28597 :
28598 : /* "scipy/linalg/_decomp_update.pyx":1239
28599 : * cdef int m = q.shape[0]
28600 : * cdef int n = q.shape[1]
28601 : * cdef int typecode = cnp.PyArray_TYPE(q) # <<<<<<<<<<<<<<
28602 : * cdef cnp.ndarray qTu
28603 : * cdef char* T = 'T'
28604 : */
28605 19666 : __pyx_v_typecode = PyArray_TYPE(__pyx_v_q);
28606 :
28607 : /* "scipy/linalg/_decomp_update.pyx":1241
28608 : * cdef int typecode = cnp.PyArray_TYPE(q)
28609 : * cdef cnp.ndarray qTu
28610 : * cdef char* T = 'T' # <<<<<<<<<<<<<<
28611 : * cdef char* C = 'C'
28612 : * cdef char* N = 'N'
28613 : */
28614 19666 : __pyx_v_T = ((char *)"T");
28615 :
28616 : /* "scipy/linalg/_decomp_update.pyx":1242
28617 : * cdef cnp.ndarray qTu
28618 : * cdef char* T = 'T'
28619 : * cdef char* C = 'C' # <<<<<<<<<<<<<<
28620 : * cdef char* N = 'N'
28621 : * cdef void* qvoid
28622 : */
28623 19666 : __pyx_v_C = ((char *)"C");
28624 :
28625 : /* "scipy/linalg/_decomp_update.pyx":1243
28626 : * cdef char* T = 'T'
28627 : * cdef char* C = 'C'
28628 : * cdef char* N = 'N' # <<<<<<<<<<<<<<
28629 : * cdef void* qvoid
28630 : * cdef void* uvoid
28631 : */
28632 19666 : __pyx_v_N = ((char *)"N");
28633 :
28634 : /* "scipy/linalg/_decomp_update.pyx":1250
28635 : * cdef int ldu, p
28636 : *
28637 : * if cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
28638 : * qvoid = extract(q, qs)
28639 : * if u.ndim == 1:
28640 : */
28641 19666 : __pyx_t_1 = PyArray_CHKFLAGS(__pyx_v_q, NPY_ARRAY_F_CONTIGUOUS);
28642 19666 : if (__pyx_t_1) {
28643 :
28644 : /* "scipy/linalg/_decomp_update.pyx":1251
28645 : *
28646 : * if cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_F_CONTIGUOUS):
28647 : * qvoid = extract(q, qs) # <<<<<<<<<<<<<<
28648 : * if u.ndim == 1:
28649 : * uvoid = extract(u, us)
28650 : */
28651 19450 : __pyx_v_qvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q, __pyx_v_qs);
28652 :
28653 : /* "scipy/linalg/_decomp_update.pyx":1252
28654 : * if cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_F_CONTIGUOUS):
28655 : * qvoid = extract(q, qs)
28656 : * if u.ndim == 1: # <<<<<<<<<<<<<<
28657 : * uvoid = extract(u, us)
28658 : * if typecode == cnp.NPY_FLOAT:
28659 : */
28660 19450 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u) == 1);
28661 19450 : if (__pyx_t_1) {
28662 :
28663 : /* "scipy/linalg/_decomp_update.pyx":1253
28664 : * qvoid = extract(q, qs)
28665 : * if u.ndim == 1:
28666 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
28667 : * if typecode == cnp.NPY_FLOAT:
28668 : * gemv(T, m, n, 1, <float*>qvoid, m,
28669 : */
28670 17998 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
28671 :
28672 : /* "scipy/linalg/_decomp_update.pyx":1254
28673 : * if u.ndim == 1:
28674 : * uvoid = extract(u, us)
28675 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
28676 : * gemv(T, m, n, 1, <float*>qvoid, m,
28677 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
28678 : */
28679 17998 : __pyx_t_1 = (__pyx_v_typecode == NPY_FLOAT);
28680 17998 : if (__pyx_t_1) {
28681 :
28682 : /* "scipy/linalg/_decomp_update.pyx":1255
28683 : * uvoid = extract(u, us)
28684 : * if typecode == cnp.NPY_FLOAT:
28685 : * gemv(T, m, n, 1, <float*>qvoid, m, # <<<<<<<<<<<<<<
28686 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
28687 : * if typecode == cnp.NPY_DOUBLE:
28688 : */
28689 301 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, ((float *)__pyx_v_qvoid), __pyx_v_m, ((float *)__pyx_v_uvoid), (__pyx_v_us[0]), 0.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(((float *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
28690 :
28691 : /* "scipy/linalg/_decomp_update.pyx":1254
28692 : * if u.ndim == 1:
28693 : * uvoid = extract(u, us)
28694 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
28695 : * gemv(T, m, n, 1, <float*>qvoid, m,
28696 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
28697 : */
28698 : }
28699 :
28700 : /* "scipy/linalg/_decomp_update.pyx":1257
28701 : * gemv(T, m, n, 1, <float*>qvoid, m,
28702 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
28703 : * if typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
28704 : * gemv(T, m, n, 1, <double*>qvoid, m,
28705 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
28706 : */
28707 17998 : __pyx_t_1 = (__pyx_v_typecode == NPY_DOUBLE);
28708 17998 : if (__pyx_t_1) {
28709 :
28710 : /* "scipy/linalg/_decomp_update.pyx":1258
28711 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
28712 : * if typecode == cnp.NPY_DOUBLE:
28713 : * gemv(T, m, n, 1, <double*>qvoid, m, # <<<<<<<<<<<<<<
28714 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
28715 : * if typecode == cnp.NPY_CFLOAT:
28716 : */
28717 16547 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_T, __pyx_v_m, __pyx_v_n, 1.0, ((double *)__pyx_v_qvoid), __pyx_v_m, ((double *)__pyx_v_uvoid), (__pyx_v_us[0]), 0.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(((double *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
28718 :
28719 : /* "scipy/linalg/_decomp_update.pyx":1257
28720 : * gemv(T, m, n, 1, <float*>qvoid, m,
28721 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
28722 : * if typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
28723 : * gemv(T, m, n, 1, <double*>qvoid, m,
28724 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
28725 : */
28726 : }
28727 :
28728 : /* "scipy/linalg/_decomp_update.pyx":1260
28729 : * gemv(T, m, n, 1, <double*>qvoid, m,
28730 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
28731 : * if typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
28732 : * gemv(C, m, n, 1, <float_complex*>qvoid, m,
28733 : * <float_complex*>uvoid, us[0], 0,
28734 : */
28735 17998 : __pyx_t_1 = (__pyx_v_typecode == NPY_CFLOAT);
28736 17998 : if (__pyx_t_1) {
28737 :
28738 : /* "scipy/linalg/_decomp_update.pyx":1261
28739 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
28740 : * if typecode == cnp.NPY_CFLOAT:
28741 : * gemv(C, m, n, 1, <float_complex*>qvoid, m, # <<<<<<<<<<<<<<
28742 : * <float_complex*>uvoid, us[0], 0,
28743 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
28744 : */
28745 301 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), ((__pyx_t_float_complex *)__pyx_v_qvoid), __pyx_v_m, ((__pyx_t_float_complex *)__pyx_v_uvoid), (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(0, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_float_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
28746 :
28747 : /* "scipy/linalg/_decomp_update.pyx":1260
28748 : * gemv(T, m, n, 1, <double*>qvoid, m,
28749 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
28750 : * if typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
28751 : * gemv(C, m, n, 1, <float_complex*>qvoid, m,
28752 : * <float_complex*>uvoid, us[0], 0,
28753 : */
28754 : }
28755 :
28756 : /* "scipy/linalg/_decomp_update.pyx":1264
28757 : * <float_complex*>uvoid, us[0], 0,
28758 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
28759 : * if typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
28760 : * gemv(C, m, n, 1, <double_complex*>qvoid, m,
28761 : * <double_complex*>uvoid, us[0], 0,
28762 : */
28763 17998 : __pyx_t_1 = (__pyx_v_typecode == NPY_CDOUBLE);
28764 17998 : if (__pyx_t_1) {
28765 :
28766 : /* "scipy/linalg/_decomp_update.pyx":1265
28767 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
28768 : * if typecode == cnp.NPY_CDOUBLE:
28769 : * gemv(C, m, n, 1, <double_complex*>qvoid, m, # <<<<<<<<<<<<<<
28770 : * <double_complex*>uvoid, us[0], 0,
28771 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
28772 : */
28773 849 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_C, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), ((__pyx_t_double_complex *)__pyx_v_qvoid), __pyx_v_m, ((__pyx_t_double_complex *)__pyx_v_uvoid), (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(0, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_double_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
28774 :
28775 : /* "scipy/linalg/_decomp_update.pyx":1264
28776 : * <float_complex*>uvoid, us[0], 0,
28777 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
28778 : * if typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
28779 : * gemv(C, m, n, 1, <double_complex*>qvoid, m,
28780 : * <double_complex*>uvoid, us[0], 0,
28781 : */
28782 : }
28783 :
28784 : /* "scipy/linalg/_decomp_update.pyx":1252
28785 : * if cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_F_CONTIGUOUS):
28786 : * qvoid = extract(q, qs)
28787 : * if u.ndim == 1: # <<<<<<<<<<<<<<
28788 : * uvoid = extract(u, us)
28789 : * if typecode == cnp.NPY_FLOAT:
28790 : */
28791 17998 : goto __pyx_L4;
28792 : }
28793 :
28794 : /* "scipy/linalg/_decomp_update.pyx":1268
28795 : * <double_complex*>uvoid, us[0], 0,
28796 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
28797 : * elif u.ndim == 2: # <<<<<<<<<<<<<<
28798 : * p = u.shape[1]
28799 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
28800 : */
28801 1452 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u) == 2);
28802 1452 : if (__pyx_t_1) {
28803 :
28804 : /* "scipy/linalg/_decomp_update.pyx":1269
28805 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
28806 : * elif u.ndim == 2:
28807 : * p = u.shape[1] # <<<<<<<<<<<<<<
28808 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
28809 : * utrans = N
28810 : */
28811 1452 : __pyx_v_p = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[1]);
28812 :
28813 : /* "scipy/linalg/_decomp_update.pyx":1270
28814 : * elif u.ndim == 2:
28815 : * p = u.shape[1]
28816 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
28817 : * utrans = N
28818 : * uvoid = extract(u, us)
28819 : */
28820 1452 : __pyx_t_1 = PyArray_CHKFLAGS(__pyx_v_u, NPY_ARRAY_F_CONTIGUOUS);
28821 1452 : if (__pyx_t_1) {
28822 :
28823 : /* "scipy/linalg/_decomp_update.pyx":1271
28824 : * p = u.shape[1]
28825 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
28826 : * utrans = N # <<<<<<<<<<<<<<
28827 : * uvoid = extract(u, us)
28828 : * ldu = u.shape[0]
28829 : */
28830 1160 : __pyx_v_utrans = __pyx_v_N;
28831 :
28832 : /* "scipy/linalg/_decomp_update.pyx":1272
28833 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
28834 : * utrans = N
28835 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
28836 : * ldu = u.shape[0]
28837 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
28838 : */
28839 1160 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
28840 :
28841 : /* "scipy/linalg/_decomp_update.pyx":1273
28842 : * utrans = N
28843 : * uvoid = extract(u, us)
28844 : * ldu = u.shape[0] # <<<<<<<<<<<<<<
28845 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
28846 : * utrans = T
28847 : */
28848 1160 : __pyx_v_ldu = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[0]);
28849 :
28850 : /* "scipy/linalg/_decomp_update.pyx":1270
28851 : * elif u.ndim == 2:
28852 : * p = u.shape[1]
28853 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
28854 : * utrans = N
28855 : * uvoid = extract(u, us)
28856 : */
28857 1160 : goto __pyx_L9;
28858 : }
28859 :
28860 : /* "scipy/linalg/_decomp_update.pyx":1274
28861 : * uvoid = extract(u, us)
28862 : * ldu = u.shape[0]
28863 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
28864 : * utrans = T
28865 : * uvoid = extract(u, us)
28866 : */
28867 292 : __pyx_t_1 = PyArray_CHKFLAGS(__pyx_v_u, NPY_ARRAY_C_CONTIGUOUS);
28868 292 : if (__pyx_t_1) {
28869 :
28870 : /* "scipy/linalg/_decomp_update.pyx":1275
28871 : * ldu = u.shape[0]
28872 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
28873 : * utrans = T # <<<<<<<<<<<<<<
28874 : * uvoid = extract(u, us)
28875 : * ldu = u.shape[1]
28876 : */
28877 260 : __pyx_v_utrans = __pyx_v_T;
28878 :
28879 : /* "scipy/linalg/_decomp_update.pyx":1276
28880 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
28881 : * utrans = T
28882 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
28883 : * ldu = u.shape[1]
28884 : * else:
28885 : */
28886 260 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
28887 :
28888 : /* "scipy/linalg/_decomp_update.pyx":1277
28889 : * utrans = T
28890 : * uvoid = extract(u, us)
28891 : * ldu = u.shape[1] # <<<<<<<<<<<<<<
28892 : * else:
28893 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
28894 : */
28895 260 : __pyx_v_ldu = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[1]);
28896 :
28897 : /* "scipy/linalg/_decomp_update.pyx":1274
28898 : * uvoid = extract(u, us)
28899 : * ldu = u.shape[0]
28900 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
28901 : * utrans = T
28902 : * uvoid = extract(u, us)
28903 : */
28904 260 : goto __pyx_L9;
28905 : }
28906 :
28907 : /* "scipy/linalg/_decomp_update.pyx":1279
28908 : * ldu = u.shape[1]
28909 : * else:
28910 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
28911 : * utrans = N
28912 : * uvoid = extract(u, us)
28913 : */
28914 : /*else*/ {
28915 32 : __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_u, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error)
28916 32 : __Pyx_GOTREF(__pyx_t_2);
28917 32 : __Pyx_DECREF_SET(__pyx_v_u, ((PyArrayObject *)__pyx_t_2));
28918 32 : __pyx_t_2 = 0;
28919 :
28920 : /* "scipy/linalg/_decomp_update.pyx":1280
28921 : * else:
28922 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
28923 : * utrans = N # <<<<<<<<<<<<<<
28924 : * uvoid = extract(u, us)
28925 : * ldu = u.shape[0]
28926 : */
28927 32 : __pyx_v_utrans = __pyx_v_N;
28928 :
28929 : /* "scipy/linalg/_decomp_update.pyx":1281
28930 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
28931 : * utrans = N
28932 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
28933 : * ldu = u.shape[0]
28934 : * if typecode == cnp.NPY_FLOAT:
28935 : */
28936 32 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
28937 :
28938 : /* "scipy/linalg/_decomp_update.pyx":1282
28939 : * utrans = N
28940 : * uvoid = extract(u, us)
28941 : * ldu = u.shape[0] # <<<<<<<<<<<<<<
28942 : * if typecode == cnp.NPY_FLOAT:
28943 : * gemm(T, utrans, m, p, m, 1, <float*>qvoid, m,
28944 : */
28945 32 : __pyx_v_ldu = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[0]);
28946 : }
28947 1452 : __pyx_L9:;
28948 :
28949 : /* "scipy/linalg/_decomp_update.pyx":1283
28950 : * uvoid = extract(u, us)
28951 : * ldu = u.shape[0]
28952 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
28953 : * gemm(T, utrans, m, p, m, 1, <float*>qvoid, m,
28954 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
28955 : */
28956 1452 : __pyx_t_1 = (__pyx_v_typecode == NPY_FLOAT);
28957 1452 : if (__pyx_t_1) {
28958 :
28959 : /* "scipy/linalg/_decomp_update.pyx":1284
28960 : * ldu = u.shape[0]
28961 : * if typecode == cnp.NPY_FLOAT:
28962 : * gemm(T, utrans, m, p, m, 1, <float*>qvoid, m, # <<<<<<<<<<<<<<
28963 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
28964 : * if typecode == cnp.NPY_DOUBLE:
28965 : */
28966 363 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_T, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, 1.0, ((float *)__pyx_v_qvoid), __pyx_v_m, ((float *)__pyx_v_uvoid), __pyx_v_ldu, 0.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(((float *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
28967 :
28968 : /* "scipy/linalg/_decomp_update.pyx":1283
28969 : * uvoid = extract(u, us)
28970 : * ldu = u.shape[0]
28971 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
28972 : * gemm(T, utrans, m, p, m, 1, <float*>qvoid, m,
28973 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
28974 : */
28975 : }
28976 :
28977 : /* "scipy/linalg/_decomp_update.pyx":1286
28978 : * gemm(T, utrans, m, p, m, 1, <float*>qvoid, m,
28979 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
28980 : * if typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
28981 : * gemm(T, utrans, m, p, m, 1, <double*>qvoid, m,
28982 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
28983 : */
28984 1452 : __pyx_t_1 = (__pyx_v_typecode == NPY_DOUBLE);
28985 1452 : if (__pyx_t_1) {
28986 :
28987 : /* "scipy/linalg/_decomp_update.pyx":1287
28988 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
28989 : * if typecode == cnp.NPY_DOUBLE:
28990 : * gemm(T, utrans, m, p, m, 1, <double*>qvoid, m, # <<<<<<<<<<<<<<
28991 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
28992 : * if typecode == cnp.NPY_CFLOAT:
28993 : */
28994 363 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_T, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, 1.0, ((double *)__pyx_v_qvoid), __pyx_v_m, ((double *)__pyx_v_uvoid), __pyx_v_ldu, 0.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(((double *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
28995 :
28996 : /* "scipy/linalg/_decomp_update.pyx":1286
28997 : * gemm(T, utrans, m, p, m, 1, <float*>qvoid, m,
28998 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
28999 : * if typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
29000 : * gemm(T, utrans, m, p, m, 1, <double*>qvoid, m,
29001 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29002 : */
29003 : }
29004 :
29005 : /* "scipy/linalg/_decomp_update.pyx":1289
29006 : * gemm(T, utrans, m, p, m, 1, <double*>qvoid, m,
29007 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29008 : * if typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
29009 : * gemm(C, utrans, m, p, m, 1, <float_complex*>qvoid, m,
29010 : * <float_complex*>uvoid, ldu, 0,
29011 : */
29012 1452 : __pyx_t_1 = (__pyx_v_typecode == NPY_CFLOAT);
29013 1452 : if (__pyx_t_1) {
29014 :
29015 : /* "scipy/linalg/_decomp_update.pyx":1290
29016 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29017 : * if typecode == cnp.NPY_CFLOAT:
29018 : * gemm(C, utrans, m, p, m, 1, <float_complex*>qvoid, m, # <<<<<<<<<<<<<<
29019 : * <float_complex*>uvoid, ldu, 0,
29020 : * col(<float_complex*>qTuvoid, qTus, k), m)
29021 : */
29022 363 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_C, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, __pyx_t_float_complex_from_parts(1, 0), ((__pyx_t_float_complex *)__pyx_v_qvoid), __pyx_v_m, ((__pyx_t_float_complex *)__pyx_v_uvoid), __pyx_v_ldu, __pyx_t_float_complex_from_parts(0, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_float_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
29023 :
29024 : /* "scipy/linalg/_decomp_update.pyx":1289
29025 : * gemm(T, utrans, m, p, m, 1, <double*>qvoid, m,
29026 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29027 : * if typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
29028 : * gemm(C, utrans, m, p, m, 1, <float_complex*>qvoid, m,
29029 : * <float_complex*>uvoid, ldu, 0,
29030 : */
29031 : }
29032 :
29033 : /* "scipy/linalg/_decomp_update.pyx":1293
29034 : * <float_complex*>uvoid, ldu, 0,
29035 : * col(<float_complex*>qTuvoid, qTus, k), m)
29036 : * if typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
29037 : * gemm(C, utrans, m, p, m, 1, <double_complex*>qvoid, m,
29038 : * <double_complex*>uvoid, ldu, 0,
29039 : */
29040 1452 : __pyx_t_1 = (__pyx_v_typecode == NPY_CDOUBLE);
29041 1452 : if (__pyx_t_1) {
29042 :
29043 : /* "scipy/linalg/_decomp_update.pyx":1294
29044 : * col(<float_complex*>qTuvoid, qTus, k), m)
29045 : * if typecode == cnp.NPY_CDOUBLE:
29046 : * gemm(C, utrans, m, p, m, 1, <double_complex*>qvoid, m, # <<<<<<<<<<<<<<
29047 : * <double_complex*>uvoid, ldu, 0,
29048 : * col(<double_complex*>qTuvoid, qTus, k), m)
29049 : */
29050 363 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_C, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, __pyx_t_double_complex_from_parts(1, 0), ((__pyx_t_double_complex *)__pyx_v_qvoid), __pyx_v_m, ((__pyx_t_double_complex *)__pyx_v_uvoid), __pyx_v_ldu, __pyx_t_double_complex_from_parts(0, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_double_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
29051 :
29052 : /* "scipy/linalg/_decomp_update.pyx":1293
29053 : * <float_complex*>uvoid, ldu, 0,
29054 : * col(<float_complex*>qTuvoid, qTus, k), m)
29055 : * if typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
29056 : * gemm(C, utrans, m, p, m, 1, <double_complex*>qvoid, m,
29057 : * <double_complex*>uvoid, ldu, 0,
29058 : */
29059 : }
29060 :
29061 : /* "scipy/linalg/_decomp_update.pyx":1268
29062 : * <double_complex*>uvoid, us[0], 0,
29063 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
29064 : * elif u.ndim == 2: # <<<<<<<<<<<<<<
29065 : * p = u.shape[1]
29066 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
29067 : */
29068 : }
29069 1089 : __pyx_L4:;
29070 :
29071 : /* "scipy/linalg/_decomp_update.pyx":1250
29072 : * cdef int ldu, p
29073 : *
29074 : * if cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
29075 : * qvoid = extract(q, qs)
29076 : * if u.ndim == 1:
29077 : */
29078 19450 : goto __pyx_L3;
29079 : }
29080 :
29081 : /* "scipy/linalg/_decomp_update.pyx":1298
29082 : * col(<double_complex*>qTuvoid, qTus, k), m)
29083 : *
29084 : * elif cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
29085 : * qvoid = extract(q, qs)
29086 : * if u.ndim == 1:
29087 : */
29088 216 : __pyx_t_1 = PyArray_CHKFLAGS(__pyx_v_q, NPY_ARRAY_C_CONTIGUOUS);
29089 216 : if (likely(__pyx_t_1)) {
29090 :
29091 : /* "scipy/linalg/_decomp_update.pyx":1299
29092 : *
29093 : * elif cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_C_CONTIGUOUS):
29094 : * qvoid = extract(q, qs) # <<<<<<<<<<<<<<
29095 : * if u.ndim == 1:
29096 : * uvoid = extract(u, us)
29097 : */
29098 216 : __pyx_v_qvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q, __pyx_v_qs);
29099 :
29100 : /* "scipy/linalg/_decomp_update.pyx":1300
29101 : * elif cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_C_CONTIGUOUS):
29102 : * qvoid = extract(q, qs)
29103 : * if u.ndim == 1: # <<<<<<<<<<<<<<
29104 : * uvoid = extract(u, us)
29105 : * if typecode == cnp.NPY_FLOAT:
29106 : */
29107 216 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u) == 1);
29108 216 : if (__pyx_t_1) {
29109 :
29110 : /* "scipy/linalg/_decomp_update.pyx":1301
29111 : * qvoid = extract(q, qs)
29112 : * if u.ndim == 1:
29113 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
29114 : * if typecode == cnp.NPY_FLOAT:
29115 : * gemv(N, m, n, 1, <float*>qvoid, n,
29116 : */
29117 192 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
29118 :
29119 : /* "scipy/linalg/_decomp_update.pyx":1302
29120 : * if u.ndim == 1:
29121 : * uvoid = extract(u, us)
29122 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
29123 : * gemv(N, m, n, 1, <float*>qvoid, n,
29124 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
29125 : */
29126 192 : __pyx_t_1 = (__pyx_v_typecode == NPY_FLOAT);
29127 192 : if (__pyx_t_1) {
29128 :
29129 : /* "scipy/linalg/_decomp_update.pyx":1303
29130 : * uvoid = extract(u, us)
29131 : * if typecode == cnp.NPY_FLOAT:
29132 : * gemv(N, m, n, 1, <float*>qvoid, n, # <<<<<<<<<<<<<<
29133 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
29134 : * if typecode == cnp.NPY_DOUBLE:
29135 : */
29136 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, 1.0, ((float *)__pyx_v_qvoid), __pyx_v_n, ((float *)__pyx_v_uvoid), (__pyx_v_us[0]), 0.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(((float *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
29137 :
29138 : /* "scipy/linalg/_decomp_update.pyx":1302
29139 : * if u.ndim == 1:
29140 : * uvoid = extract(u, us)
29141 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
29142 : * gemv(N, m, n, 1, <float*>qvoid, n,
29143 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
29144 : */
29145 : }
29146 :
29147 : /* "scipy/linalg/_decomp_update.pyx":1305
29148 : * gemv(N, m, n, 1, <float*>qvoid, n,
29149 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
29150 : * if typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
29151 : * gemv(N, m, n, 1, <double*>qvoid, n,
29152 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
29153 : */
29154 192 : __pyx_t_1 = (__pyx_v_typecode == NPY_DOUBLE);
29155 192 : if (__pyx_t_1) {
29156 :
29157 : /* "scipy/linalg/_decomp_update.pyx":1306
29158 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
29159 : * if typecode == cnp.NPY_DOUBLE:
29160 : * gemv(N, m, n, 1, <double*>qvoid, n, # <<<<<<<<<<<<<<
29161 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
29162 : * if typecode == cnp.NPY_CFLOAT:
29163 : */
29164 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, 1.0, ((double *)__pyx_v_qvoid), __pyx_v_n, ((double *)__pyx_v_uvoid), (__pyx_v_us[0]), 0.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(((double *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
29165 :
29166 : /* "scipy/linalg/_decomp_update.pyx":1305
29167 : * gemv(N, m, n, 1, <float*>qvoid, n,
29168 : * <float*>uvoid, us[0], 0, col(<float*>qTuvoid, qTus, k), qTus[0])
29169 : * if typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
29170 : * gemv(N, m, n, 1, <double*>qvoid, n,
29171 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
29172 : */
29173 : }
29174 :
29175 : /* "scipy/linalg/_decomp_update.pyx":1308
29176 : * gemv(N, m, n, 1, <double*>qvoid, n,
29177 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
29178 : * if typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
29179 : * blas_t_conj(m, <float_complex*>uvoid, us)
29180 : * gemv(N, m, n, 1, <float_complex*>qvoid, n,
29181 : */
29182 192 : __pyx_t_1 = (__pyx_v_typecode == NPY_CFLOAT);
29183 192 : if (__pyx_t_1) {
29184 :
29185 : /* "scipy/linalg/_decomp_update.pyx":1309
29186 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
29187 : * if typecode == cnp.NPY_CFLOAT:
29188 : * blas_t_conj(m, <float_complex*>uvoid, us) # <<<<<<<<<<<<<<
29189 : * gemv(N, m, n, 1, <float_complex*>qvoid, n,
29190 : * <float_complex*>uvoid, us[0], 0,
29191 : */
29192 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, ((__pyx_t_float_complex *)__pyx_v_uvoid), __pyx_v_us);
29193 :
29194 : /* "scipy/linalg/_decomp_update.pyx":1310
29195 : * if typecode == cnp.NPY_CFLOAT:
29196 : * blas_t_conj(m, <float_complex*>uvoid, us)
29197 : * gemv(N, m, n, 1, <float_complex*>qvoid, n, # <<<<<<<<<<<<<<
29198 : * <float_complex*>uvoid, us[0], 0,
29199 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
29200 : */
29201 96 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_float_complex_from_parts(1, 0), ((__pyx_t_float_complex *)__pyx_v_qvoid), __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_uvoid), (__pyx_v_us[0]), __pyx_t_float_complex_from_parts(0, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_float_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
29202 :
29203 : /* "scipy/linalg/_decomp_update.pyx":1313
29204 : * <float_complex*>uvoid, us[0], 0,
29205 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
29206 : * blas_t_conj(m, col(<float_complex*>qTuvoid, qTus, k), qTus) # <<<<<<<<<<<<<<
29207 : * if typecode == cnp.NPY_CDOUBLE:
29208 : * blas_t_conj(m, <double_complex*>uvoid, us)
29209 : */
29210 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_float_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_qTus);
29211 :
29212 : /* "scipy/linalg/_decomp_update.pyx":1308
29213 : * gemv(N, m, n, 1, <double*>qvoid, n,
29214 : * <double*>uvoid, us[0], 0, col(<double*>qTuvoid, qTus, k), qTus[0])
29215 : * if typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
29216 : * blas_t_conj(m, <float_complex*>uvoid, us)
29217 : * gemv(N, m, n, 1, <float_complex*>qvoid, n,
29218 : */
29219 : }
29220 :
29221 : /* "scipy/linalg/_decomp_update.pyx":1314
29222 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
29223 : * blas_t_conj(m, col(<float_complex*>qTuvoid, qTus, k), qTus)
29224 : * if typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
29225 : * blas_t_conj(m, <double_complex*>uvoid, us)
29226 : * gemv(N, m, n, 1, <double_complex*>qvoid, n,
29227 : */
29228 192 : __pyx_t_1 = (__pyx_v_typecode == NPY_CDOUBLE);
29229 192 : if (__pyx_t_1) {
29230 :
29231 : /* "scipy/linalg/_decomp_update.pyx":1315
29232 : * blas_t_conj(m, col(<float_complex*>qTuvoid, qTus, k), qTus)
29233 : * if typecode == cnp.NPY_CDOUBLE:
29234 : * blas_t_conj(m, <double_complex*>uvoid, us) # <<<<<<<<<<<<<<
29235 : * gemv(N, m, n, 1, <double_complex*>qvoid, n,
29236 : * <double_complex*>uvoid, us[0], 0,
29237 : */
29238 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, ((__pyx_t_double_complex *)__pyx_v_uvoid), __pyx_v_us);
29239 :
29240 : /* "scipy/linalg/_decomp_update.pyx":1316
29241 : * if typecode == cnp.NPY_CDOUBLE:
29242 : * blas_t_conj(m, <double_complex*>uvoid, us)
29243 : * gemv(N, m, n, 1, <double_complex*>qvoid, n, # <<<<<<<<<<<<<<
29244 : * <double_complex*>uvoid, us[0], 0,
29245 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
29246 : */
29247 96 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemv(__pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_t_double_complex_from_parts(1, 0), ((__pyx_t_double_complex *)__pyx_v_qvoid), __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_uvoid), (__pyx_v_us[0]), __pyx_t_double_complex_from_parts(0, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_double_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), (__pyx_v_qTus[0]));
29248 :
29249 : /* "scipy/linalg/_decomp_update.pyx":1319
29250 : * <double_complex*>uvoid, us[0], 0,
29251 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
29252 : * blas_t_conj(m, col(<double_complex*>qTuvoid, qTus, k), qTus) # <<<<<<<<<<<<<<
29253 : * elif u.ndim == 2:
29254 : * p = u.shape[1]
29255 : */
29256 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_conj(__pyx_v_m, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_double_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_qTus);
29257 :
29258 : /* "scipy/linalg/_decomp_update.pyx":1314
29259 : * col(<float_complex*>qTuvoid, qTus, k), qTus[0])
29260 : * blas_t_conj(m, col(<float_complex*>qTuvoid, qTus, k), qTus)
29261 : * if typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
29262 : * blas_t_conj(m, <double_complex*>uvoid, us)
29263 : * gemv(N, m, n, 1, <double_complex*>qvoid, n,
29264 : */
29265 : }
29266 :
29267 : /* "scipy/linalg/_decomp_update.pyx":1300
29268 : * elif cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_C_CONTIGUOUS):
29269 : * qvoid = extract(q, qs)
29270 : * if u.ndim == 1: # <<<<<<<<<<<<<<
29271 : * uvoid = extract(u, us)
29272 : * if typecode == cnp.NPY_FLOAT:
29273 : */
29274 192 : goto __pyx_L14;
29275 : }
29276 :
29277 : /* "scipy/linalg/_decomp_update.pyx":1320
29278 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
29279 : * blas_t_conj(m, col(<double_complex*>qTuvoid, qTus, k), qTus)
29280 : * elif u.ndim == 2: # <<<<<<<<<<<<<<
29281 : * p = u.shape[1]
29282 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
29283 : */
29284 24 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u) == 2);
29285 24 : if (likely(__pyx_t_1)) {
29286 :
29287 : /* "scipy/linalg/_decomp_update.pyx":1321
29288 : * blas_t_conj(m, col(<double_complex*>qTuvoid, qTus, k), qTus)
29289 : * elif u.ndim == 2:
29290 : * p = u.shape[1] # <<<<<<<<<<<<<<
29291 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
29292 : * utrans = N
29293 : */
29294 24 : __pyx_v_p = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[1]);
29295 :
29296 : /* "scipy/linalg/_decomp_update.pyx":1322
29297 : * elif u.ndim == 2:
29298 : * p = u.shape[1]
29299 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
29300 : * utrans = N
29301 : * uvoid = extract(u, us)
29302 : */
29303 24 : __pyx_t_1 = PyArray_CHKFLAGS(__pyx_v_u, NPY_ARRAY_F_CONTIGUOUS);
29304 24 : if (__pyx_t_1) {
29305 :
29306 : /* "scipy/linalg/_decomp_update.pyx":1323
29307 : * p = u.shape[1]
29308 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
29309 : * utrans = N # <<<<<<<<<<<<<<
29310 : * uvoid = extract(u, us)
29311 : * ldu = u.shape[0]
29312 : */
29313 12 : __pyx_v_utrans = __pyx_v_N;
29314 :
29315 : /* "scipy/linalg/_decomp_update.pyx":1324
29316 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
29317 : * utrans = N
29318 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
29319 : * ldu = u.shape[0]
29320 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
29321 : */
29322 12 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
29323 :
29324 : /* "scipy/linalg/_decomp_update.pyx":1325
29325 : * utrans = N
29326 : * uvoid = extract(u, us)
29327 : * ldu = u.shape[0] # <<<<<<<<<<<<<<
29328 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
29329 : * utrans = T
29330 : */
29331 12 : __pyx_v_ldu = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[0]);
29332 :
29333 : /* "scipy/linalg/_decomp_update.pyx":1322
29334 : * elif u.ndim == 2:
29335 : * p = u.shape[1]
29336 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
29337 : * utrans = N
29338 : * uvoid = extract(u, us)
29339 : */
29340 12 : goto __pyx_L19;
29341 : }
29342 :
29343 : /* "scipy/linalg/_decomp_update.pyx":1326
29344 : * uvoid = extract(u, us)
29345 : * ldu = u.shape[0]
29346 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
29347 : * utrans = T
29348 : * uvoid = extract(u, us)
29349 : */
29350 12 : __pyx_t_1 = PyArray_CHKFLAGS(__pyx_v_u, NPY_ARRAY_C_CONTIGUOUS);
29351 12 : if (__pyx_t_1) {
29352 :
29353 : /* "scipy/linalg/_decomp_update.pyx":1327
29354 : * ldu = u.shape[0]
29355 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
29356 : * utrans = T # <<<<<<<<<<<<<<
29357 : * uvoid = extract(u, us)
29358 : * ldu = u.shape[1]
29359 : */
29360 4 : __pyx_v_utrans = __pyx_v_T;
29361 :
29362 : /* "scipy/linalg/_decomp_update.pyx":1328
29363 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS):
29364 : * utrans = T
29365 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
29366 : * ldu = u.shape[1]
29367 : * else:
29368 : */
29369 4 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
29370 :
29371 : /* "scipy/linalg/_decomp_update.pyx":1329
29372 : * utrans = T
29373 : * uvoid = extract(u, us)
29374 : * ldu = u.shape[1] # <<<<<<<<<<<<<<
29375 : * else:
29376 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
29377 : */
29378 4 : __pyx_v_ldu = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[1]);
29379 :
29380 : /* "scipy/linalg/_decomp_update.pyx":1326
29381 : * uvoid = extract(u, us)
29382 : * ldu = u.shape[0]
29383 : * elif cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
29384 : * utrans = T
29385 : * uvoid = extract(u, us)
29386 : */
29387 4 : goto __pyx_L19;
29388 : }
29389 :
29390 : /* "scipy/linalg/_decomp_update.pyx":1331
29391 : * ldu = u.shape[1]
29392 : * else:
29393 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
29394 : * utrans = N
29395 : * uvoid = extract(u, us)
29396 : */
29397 : /*else*/ {
29398 8 : __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_u, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
29399 8 : __Pyx_GOTREF(__pyx_t_2);
29400 8 : __Pyx_DECREF_SET(__pyx_v_u, ((PyArrayObject *)__pyx_t_2));
29401 8 : __pyx_t_2 = 0;
29402 :
29403 : /* "scipy/linalg/_decomp_update.pyx":1332
29404 : * else:
29405 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
29406 : * utrans = N # <<<<<<<<<<<<<<
29407 : * uvoid = extract(u, us)
29408 : * ldu = u.shape[0]
29409 : */
29410 8 : __pyx_v_utrans = __pyx_v_N;
29411 :
29412 : /* "scipy/linalg/_decomp_update.pyx":1333
29413 : * u = PyArray_FromArray(u, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
29414 : * utrans = N
29415 : * uvoid = extract(u, us) # <<<<<<<<<<<<<<
29416 : * ldu = u.shape[0]
29417 : * if typecode == cnp.NPY_FLOAT:
29418 : */
29419 8 : __pyx_v_uvoid = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u, __pyx_v_us);
29420 :
29421 : /* "scipy/linalg/_decomp_update.pyx":1334
29422 : * utrans = N
29423 : * uvoid = extract(u, us)
29424 : * ldu = u.shape[0] # <<<<<<<<<<<<<<
29425 : * if typecode == cnp.NPY_FLOAT:
29426 : * gemm(N, utrans, m, p, m, 1, <float*>qvoid, n,
29427 : */
29428 8 : __pyx_v_ldu = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u)[0]);
29429 : }
29430 24 : __pyx_L19:;
29431 :
29432 : /* "scipy/linalg/_decomp_update.pyx":1335
29433 : * uvoid = extract(u, us)
29434 : * ldu = u.shape[0]
29435 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
29436 : * gemm(N, utrans, m, p, m, 1, <float*>qvoid, n,
29437 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
29438 : */
29439 24 : switch (__pyx_v_typecode) {
29440 : case NPY_FLOAT:
29441 :
29442 : /* "scipy/linalg/_decomp_update.pyx":1336
29443 : * ldu = u.shape[0]
29444 : * if typecode == cnp.NPY_FLOAT:
29445 : * gemm(N, utrans, m, p, m, 1, <float*>qvoid, n, # <<<<<<<<<<<<<<
29446 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
29447 : * elif typecode == cnp.NPY_DOUBLE:
29448 : */
29449 6 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_N, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, 1.0, ((float *)__pyx_v_qvoid), __pyx_v_n, ((float *)__pyx_v_uvoid), __pyx_v_ldu, 0.0, __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_col(((float *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
29450 :
29451 : /* "scipy/linalg/_decomp_update.pyx":1335
29452 : * uvoid = extract(u, us)
29453 : * ldu = u.shape[0]
29454 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
29455 : * gemm(N, utrans, m, p, m, 1, <float*>qvoid, n,
29456 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
29457 : */
29458 6 : break;
29459 : case NPY_DOUBLE:
29460 :
29461 : /* "scipy/linalg/_decomp_update.pyx":1339
29462 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
29463 : * elif typecode == cnp.NPY_DOUBLE:
29464 : * gemm(N, utrans, m, p, m, 1, <double*>qvoid, n, # <<<<<<<<<<<<<<
29465 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29466 : * elif typecode == cnp.NPY_CFLOAT:
29467 : */
29468 6 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_N, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, 1.0, ((double *)__pyx_v_qvoid), __pyx_v_n, ((double *)__pyx_v_uvoid), __pyx_v_ldu, 0.0, __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_col(((double *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
29469 :
29470 : /* "scipy/linalg/_decomp_update.pyx":1338
29471 : * gemm(N, utrans, m, p, m, 1, <float*>qvoid, n,
29472 : * <float*>uvoid, ldu, 0, col(<float*>qTuvoid, qTus, k), m)
29473 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
29474 : * gemm(N, utrans, m, p, m, 1, <double*>qvoid, n,
29475 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29476 : */
29477 6 : break;
29478 6 : case NPY_CFLOAT:
29479 :
29480 : /* "scipy/linalg/_decomp_update.pyx":1342
29481 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29482 : * elif typecode == cnp.NPY_CFLOAT:
29483 : * blas_t_2d_conj(m, p, <float_complex*>uvoid, us) # <<<<<<<<<<<<<<
29484 : * gemm(N, utrans, m, p, m, 1, <float_complex*>qvoid, n,
29485 : * <float_complex*>uvoid, ldu, 0,
29486 : */
29487 6 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_m, __pyx_v_p, ((__pyx_t_float_complex *)__pyx_v_uvoid), __pyx_v_us);
29488 :
29489 : /* "scipy/linalg/_decomp_update.pyx":1343
29490 : * elif typecode == cnp.NPY_CFLOAT:
29491 : * blas_t_2d_conj(m, p, <float_complex*>uvoid, us)
29492 : * gemm(N, utrans, m, p, m, 1, <float_complex*>qvoid, n, # <<<<<<<<<<<<<<
29493 : * <float_complex*>uvoid, ldu, 0,
29494 : * col(<float_complex*>qTuvoid, qTus, k), m)
29495 : */
29496 12 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_N, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, __pyx_t_float_complex_from_parts(1, 0), ((__pyx_t_float_complex *)__pyx_v_qvoid), __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_uvoid), __pyx_v_ldu, __pyx_t_float_complex_from_parts(0, 0), __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_float_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
29497 :
29498 : /* "scipy/linalg/_decomp_update.pyx":1346
29499 : * <float_complex*>uvoid, ldu, 0,
29500 : * col(<float_complex*>qTuvoid, qTus, k), m)
29501 : * blas_t_2d_conj(m, p, col(<float_complex*>qTuvoid, qTus, k), qTus) # <<<<<<<<<<<<<<
29502 : * elif typecode == cnp.NPY_CDOUBLE:
29503 : * blas_t_2d_conj(m, p, <double_complex*>uvoid, us)
29504 : */
29505 6 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_m, __pyx_v_p, __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_float_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_qTus);
29506 :
29507 : /* "scipy/linalg/_decomp_update.pyx":1341
29508 : * gemm(N, utrans, m, p, m, 1, <double*>qvoid, n,
29509 : * <double*>uvoid, ldu, 0, col(<double*>qTuvoid, qTus, k), m)
29510 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
29511 : * blas_t_2d_conj(m, p, <float_complex*>uvoid, us)
29512 : * gemm(N, utrans, m, p, m, 1, <float_complex*>qvoid, n,
29513 : */
29514 6 : break;
29515 6 : case NPY_CDOUBLE:
29516 :
29517 : /* "scipy/linalg/_decomp_update.pyx":1348
29518 : * blas_t_2d_conj(m, p, col(<float_complex*>qTuvoid, qTus, k), qTus)
29519 : * elif typecode == cnp.NPY_CDOUBLE:
29520 : * blas_t_2d_conj(m, p, <double_complex*>uvoid, us) # <<<<<<<<<<<<<<
29521 : * gemm(N, utrans, m, p, m, 1, <double_complex*>qvoid, n,
29522 : * <double_complex*>uvoid, ldu, 0,
29523 : */
29524 6 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_m, __pyx_v_p, ((__pyx_t_double_complex *)__pyx_v_uvoid), __pyx_v_us);
29525 :
29526 : /* "scipy/linalg/_decomp_update.pyx":1349
29527 : * elif typecode == cnp.NPY_CDOUBLE:
29528 : * blas_t_2d_conj(m, p, <double_complex*>uvoid, us)
29529 : * gemm(N, utrans, m, p, m, 1, <double_complex*>qvoid, n, # <<<<<<<<<<<<<<
29530 : * <double_complex*>uvoid, ldu, 0,
29531 : * col(<double_complex*>qTuvoid, qTus, k), m)
29532 : */
29533 12 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_gemm(__pyx_v_N, __pyx_v_utrans, __pyx_v_m, __pyx_v_p, __pyx_v_m, __pyx_t_double_complex_from_parts(1, 0), ((__pyx_t_double_complex *)__pyx_v_qvoid), __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_uvoid), __pyx_v_ldu, __pyx_t_double_complex_from_parts(0, 0), __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_double_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_m);
29534 :
29535 : /* "scipy/linalg/_decomp_update.pyx":1352
29536 : * <double_complex*>uvoid, ldu, 0,
29537 : * col(<double_complex*>qTuvoid, qTus, k), m)
29538 : * blas_t_2d_conj(m, p, col(<double_complex*>qTuvoid, qTus, k), qTus) # <<<<<<<<<<<<<<
29539 : * else:
29540 : * raise ValueError('Shape of u is incorrect, should be 1 <= u.ndim <= 2')
29541 : */
29542 6 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_blas_t_2d_conj(__pyx_v_m, __pyx_v_p, __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_col(((__pyx_t_double_complex *)__pyx_v_qTuvoid), __pyx_v_qTus, __pyx_v_k), __pyx_v_qTus);
29543 :
29544 : /* "scipy/linalg/_decomp_update.pyx":1347
29545 : * col(<float_complex*>qTuvoid, qTus, k), m)
29546 : * blas_t_2d_conj(m, p, col(<float_complex*>qTuvoid, qTus, k), qTus)
29547 : * elif typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
29548 : * blas_t_2d_conj(m, p, <double_complex*>uvoid, us)
29549 : * gemm(N, utrans, m, p, m, 1, <double_complex*>qvoid, n,
29550 : */
29551 6 : break;
29552 : default: break;
29553 : }
29554 :
29555 : /* "scipy/linalg/_decomp_update.pyx":1320
29556 : * col(<double_complex*>qTuvoid, qTus, k), qTus[0])
29557 : * blas_t_conj(m, col(<double_complex*>qTuvoid, qTus, k), qTus)
29558 : * elif u.ndim == 2: # <<<<<<<<<<<<<<
29559 : * p = u.shape[1]
29560 : * if cnp.PyArray_CHKFLAGS(u, cnp.NPY_ARRAY_F_CONTIGUOUS):
29561 : */
29562 24 : goto __pyx_L14;
29563 : }
29564 :
29565 : /* "scipy/linalg/_decomp_update.pyx":1354
29566 : * blas_t_2d_conj(m, p, col(<double_complex*>qTuvoid, qTus, k), qTus)
29567 : * else:
29568 : * raise ValueError('Shape of u is incorrect, should be 1 <= u.ndim <= 2') # <<<<<<<<<<<<<<
29569 : * else:
29570 : * raise ValueError('q must be either F or C contiguous')
29571 : */
29572 : /*else*/ {
29573 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
29574 0 : __Pyx_GOTREF(__pyx_t_2);
29575 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
29576 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29577 0 : __PYX_ERR(0, 1354, __pyx_L1_error)
29578 : }
29579 216 : __pyx_L14:;
29580 :
29581 : /* "scipy/linalg/_decomp_update.pyx":1298
29582 : * col(<double_complex*>qTuvoid, qTus, k), m)
29583 : *
29584 : * elif cnp.PyArray_CHKFLAGS(q, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
29585 : * qvoid = extract(q, qs)
29586 : * if u.ndim == 1:
29587 : */
29588 216 : goto __pyx_L3;
29589 : }
29590 :
29591 : /* "scipy/linalg/_decomp_update.pyx":1356
29592 : * raise ValueError('Shape of u is incorrect, should be 1 <= u.ndim <= 2')
29593 : * else:
29594 : * raise ValueError('q must be either F or C contiguous') # <<<<<<<<<<<<<<
29595 : *
29596 : * cdef validate_array(cnp.ndarray a, bint chkfinite):
29597 : */
29598 : /*else*/ {
29599 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1356, __pyx_L1_error)
29600 0 : __Pyx_GOTREF(__pyx_t_2);
29601 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
29602 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29603 0 : __PYX_ERR(0, 1356, __pyx_L1_error)
29604 : }
29605 19666 : __pyx_L3:;
29606 :
29607 : /* "scipy/linalg/_decomp_update.pyx":1227
29608 : * return qTu
29609 : *
29610 : * cdef form_qTu(cnp.ndarray q, cnp.ndarray u, void* qTuvoid, int* qTus, int k): # <<<<<<<<<<<<<<
29611 : * """ assuming here that q and u have compatible shapes, and are the same
29612 : * type + Q is contiguous. This function is preferable over simply
29613 : */
29614 :
29615 : /* function exit code */
29616 19666 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29617 19666 : goto __pyx_L0;
29618 0 : __pyx_L1_error:;
29619 0 : __Pyx_XDECREF(__pyx_t_2);
29620 0 : __Pyx_AddTraceback("scipy.linalg._decomp_update.form_qTu", __pyx_clineno, __pyx_lineno, __pyx_filename);
29621 0 : __pyx_r = 0;
29622 19666 : __pyx_L0:;
29623 19666 : __Pyx_XDECREF((PyObject *)__pyx_v_u);
29624 19666 : __Pyx_XGIVEREF(__pyx_r);
29625 19666 : __Pyx_RefNannyFinishContext();
29626 19666 : return __pyx_r;
29627 : }
29628 :
29629 : /* "scipy/linalg/_decomp_update.pyx":1358
29630 : * raise ValueError('q must be either F or C contiguous')
29631 : *
29632 : * cdef validate_array(cnp.ndarray a, bint chkfinite): # <<<<<<<<<<<<<<
29633 : * # here we check that a has positive strides and that its size is small
29634 : * # enough to fit in into an int, as BLAS/LAPACK require
29635 : */
29636 :
29637 72382 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_validate_array(PyArrayObject *__pyx_v_a, int __pyx_v_chkfinite) {
29638 72382 : int __pyx_v_copy;
29639 72382 : int __pyx_v_j;
29640 72382 : PyObject *__pyx_r = NULL;
29641 : __Pyx_RefNannyDeclarations
29642 72382 : int __pyx_t_1;
29643 72382 : int __pyx_t_2;
29644 72382 : int __pyx_t_3;
29645 72382 : int __pyx_t_4;
29646 72382 : npy_intp __pyx_t_5;
29647 72382 : npy_intp __pyx_t_6;
29648 72382 : PyObject *__pyx_t_7 = NULL;
29649 72382 : PyObject *__pyx_t_8 = NULL;
29650 72382 : PyObject *__pyx_t_9 = NULL;
29651 72382 : PyObject *__pyx_t_10 = NULL;
29652 72382 : unsigned int __pyx_t_11;
29653 72382 : int __pyx_t_12;
29654 72382 : int __pyx_lineno = 0;
29655 72382 : const char *__pyx_filename = NULL;
29656 72382 : int __pyx_clineno = 0;
29657 72382 : __Pyx_RefNannySetupContext("validate_array", 1);
29658 :
29659 : /* "scipy/linalg/_decomp_update.pyx":1361
29660 : * # here we check that a has positive strides and that its size is small
29661 : * # enough to fit in into an int, as BLAS/LAPACK require
29662 : * cdef bint copy = False # <<<<<<<<<<<<<<
29663 : * cdef int j
29664 : *
29665 : */
29666 72382 : __pyx_v_copy = 0;
29667 :
29668 : /* "scipy/linalg/_decomp_update.pyx":1364
29669 : * cdef int j
29670 : *
29671 : * for j in range(a.ndim): # <<<<<<<<<<<<<<
29672 : * if a.strides[j] <= 0:
29673 : * copy = True
29674 : */
29675 72382 : __pyx_t_1 = __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_a);
29676 72382 : __pyx_t_2 = __pyx_t_1;
29677 197040 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
29678 124658 : __pyx_v_j = __pyx_t_3;
29679 :
29680 : /* "scipy/linalg/_decomp_update.pyx":1365
29681 : *
29682 : * for j in range(a.ndim):
29683 : * if a.strides[j] <= 0: # <<<<<<<<<<<<<<
29684 : * copy = True
29685 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX:
29686 : */
29687 124658 : __pyx_t_4 = ((__pyx_f_5numpy_7ndarray_7strides_strides(__pyx_v_a)[__pyx_v_j]) <= 0);
29688 124658 : if (__pyx_t_4) {
29689 :
29690 : /* "scipy/linalg/_decomp_update.pyx":1366
29691 : * for j in range(a.ndim):
29692 : * if a.strides[j] <= 0:
29693 : * copy = True # <<<<<<<<<<<<<<
29694 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX:
29695 : * copy = True
29696 : */
29697 7036 : __pyx_v_copy = 1;
29698 :
29699 : /* "scipy/linalg/_decomp_update.pyx":1365
29700 : *
29701 : * for j in range(a.ndim):
29702 : * if a.strides[j] <= 0: # <<<<<<<<<<<<<<
29703 : * copy = True
29704 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX:
29705 : */
29706 : }
29707 :
29708 : /* "scipy/linalg/_decomp_update.pyx":1367
29709 : * if a.strides[j] <= 0:
29710 : * copy = True
29711 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX: # <<<<<<<<<<<<<<
29712 : * copy = True
29713 : * if a.shape[j] >= libc.limits.INT_MAX:
29714 : */
29715 124658 : __pyx_t_5 = (__pyx_f_5numpy_7ndarray_7strides_strides(__pyx_v_a)[__pyx_v_j]);
29716 124658 : __pyx_t_6 = PyArray_ITEMSIZE(__pyx_v_a);
29717 124658 : if (unlikely(__pyx_t_6 == 0)) {
29718 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
29719 0 : __PYX_ERR(0, 1367, __pyx_L1_error)
29720 : }
29721 124658 : __pyx_t_4 = ((((double)__pyx_t_5) / ((double)__pyx_t_6)) >= INT_MAX);
29722 124658 : if (__pyx_t_4) {
29723 :
29724 : /* "scipy/linalg/_decomp_update.pyx":1368
29725 : * copy = True
29726 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX:
29727 : * copy = True # <<<<<<<<<<<<<<
29728 : * if a.shape[j] >= libc.limits.INT_MAX:
29729 : * raise ValueError('Input array too large for use with BLAS')
29730 : */
29731 0 : __pyx_v_copy = 1;
29732 :
29733 : /* "scipy/linalg/_decomp_update.pyx":1367
29734 : * if a.strides[j] <= 0:
29735 : * copy = True
29736 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX: # <<<<<<<<<<<<<<
29737 : * copy = True
29738 : * if a.shape[j] >= libc.limits.INT_MAX:
29739 : */
29740 : }
29741 :
29742 : /* "scipy/linalg/_decomp_update.pyx":1369
29743 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX:
29744 : * copy = True
29745 : * if a.shape[j] >= libc.limits.INT_MAX: # <<<<<<<<<<<<<<
29746 : * raise ValueError('Input array too large for use with BLAS')
29747 : *
29748 : */
29749 124658 : __pyx_t_4 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_a)[__pyx_v_j]) >= INT_MAX);
29750 124658 : if (unlikely(__pyx_t_4)) {
29751 :
29752 : /* "scipy/linalg/_decomp_update.pyx":1370
29753 : * copy = True
29754 : * if a.shape[j] >= libc.limits.INT_MAX:
29755 : * raise ValueError('Input array too large for use with BLAS') # <<<<<<<<<<<<<<
29756 : *
29757 : * if chkfinite:
29758 : */
29759 0 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1370, __pyx_L1_error)
29760 0 : __Pyx_GOTREF(__pyx_t_7);
29761 0 : __Pyx_Raise(__pyx_t_7, 0, 0, 0);
29762 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29763 0 : __PYX_ERR(0, 1370, __pyx_L1_error)
29764 :
29765 : /* "scipy/linalg/_decomp_update.pyx":1369
29766 : * if (a.strides[j] / cnp.PyArray_ITEMSIZE(a)) >= libc.limits.INT_MAX:
29767 : * copy = True
29768 : * if a.shape[j] >= libc.limits.INT_MAX: # <<<<<<<<<<<<<<
29769 : * raise ValueError('Input array too large for use with BLAS')
29770 : *
29771 : */
29772 : }
29773 : }
29774 :
29775 : /* "scipy/linalg/_decomp_update.pyx":1372
29776 : * raise ValueError('Input array too large for use with BLAS')
29777 : *
29778 : * if chkfinite: # <<<<<<<<<<<<<<
29779 : * if not np.isfinite(a).all():
29780 : * raise ValueError('array must not contain infs or NaNs')
29781 : */
29782 72382 : if (__pyx_v_chkfinite) {
29783 :
29784 : /* "scipy/linalg/_decomp_update.pyx":1373
29785 : *
29786 : * if chkfinite:
29787 : * if not np.isfinite(a).all(): # <<<<<<<<<<<<<<
29788 : * raise ValueError('array must not contain infs or NaNs')
29789 : *
29790 : */
29791 22000 : __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1373, __pyx_L1_error)
29792 22000 : __Pyx_GOTREF(__pyx_t_9);
29793 22000 : __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_isfinite); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1373, __pyx_L1_error)
29794 22000 : __Pyx_GOTREF(__pyx_t_10);
29795 22000 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
29796 22000 : __pyx_t_9 = NULL;
29797 22000 : __pyx_t_11 = 0;
29798 : #if CYTHON_UNPACK_METHODS
29799 22000 : if (unlikely(PyMethod_Check(__pyx_t_10))) {
29800 0 : __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
29801 0 : if (likely(__pyx_t_9)) {
29802 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
29803 0 : __Pyx_INCREF(__pyx_t_9);
29804 0 : __Pyx_INCREF(function);
29805 0 : __Pyx_DECREF_SET(__pyx_t_10, function);
29806 : __pyx_t_11 = 1;
29807 : }
29808 : }
29809 : #endif
29810 : {
29811 22000 : PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_v_a)};
29812 22000 : __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
29813 22000 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
29814 22000 : if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1373, __pyx_L1_error)
29815 22000 : __Pyx_GOTREF(__pyx_t_8);
29816 22000 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29817 : }
29818 22000 : __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_all); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1373, __pyx_L1_error)
29819 22000 : __Pyx_GOTREF(__pyx_t_10);
29820 22000 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
29821 22000 : __pyx_t_8 = NULL;
29822 22000 : __pyx_t_11 = 0;
29823 : #if CYTHON_UNPACK_METHODS
29824 22000 : if (likely(PyMethod_Check(__pyx_t_10))) {
29825 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
29826 0 : if (likely(__pyx_t_8)) {
29827 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
29828 0 : __Pyx_INCREF(__pyx_t_8);
29829 0 : __Pyx_INCREF(function);
29830 0 : __Pyx_DECREF_SET(__pyx_t_10, function);
29831 : __pyx_t_11 = 1;
29832 : }
29833 : }
29834 : #endif
29835 : {
29836 22000 : PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
29837 22000 : __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
29838 22000 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
29839 22000 : if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error)
29840 22000 : __Pyx_GOTREF(__pyx_t_7);
29841 22000 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29842 : }
29843 22000 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1373, __pyx_L1_error)
29844 22000 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29845 22000 : __pyx_t_12 = (!__pyx_t_4);
29846 22000 : if (unlikely(__pyx_t_12)) {
29847 :
29848 : /* "scipy/linalg/_decomp_update.pyx":1374
29849 : * if chkfinite:
29850 : * if not np.isfinite(a).all():
29851 : * raise ValueError('array must not contain infs or NaNs') # <<<<<<<<<<<<<<
29852 : *
29853 : * if copy:
29854 : */
29855 132 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error)
29856 132 : __Pyx_GOTREF(__pyx_t_7);
29857 132 : __Pyx_Raise(__pyx_t_7, 0, 0, 0);
29858 132 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29859 132 : __PYX_ERR(0, 1374, __pyx_L1_error)
29860 :
29861 : /* "scipy/linalg/_decomp_update.pyx":1373
29862 : *
29863 : * if chkfinite:
29864 : * if not np.isfinite(a).all(): # <<<<<<<<<<<<<<
29865 : * raise ValueError('array must not contain infs or NaNs')
29866 : *
29867 : */
29868 : }
29869 :
29870 : /* "scipy/linalg/_decomp_update.pyx":1372
29871 : * raise ValueError('Input array too large for use with BLAS')
29872 : *
29873 : * if chkfinite: # <<<<<<<<<<<<<<
29874 : * if not np.isfinite(a).all():
29875 : * raise ValueError('array must not contain infs or NaNs')
29876 : */
29877 : }
29878 :
29879 : /* "scipy/linalg/_decomp_update.pyx":1376
29880 : * raise ValueError('array must not contain infs or NaNs')
29881 : *
29882 : * if copy: # <<<<<<<<<<<<<<
29883 : * return PyArray_FromArray(a, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
29884 : * return a
29885 : */
29886 72250 : if (__pyx_v_copy) {
29887 :
29888 : /* "scipy/linalg/_decomp_update.pyx":1377
29889 : *
29890 : * if copy:
29891 : * return PyArray_FromArray(a, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
29892 : * return a
29893 : *
29894 : */
29895 3602 : __Pyx_XDECREF(__pyx_r);
29896 3602 : __pyx_t_7 = ((PyObject *)PyArray_FromArray(__pyx_v_a, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error)
29897 3602 : __Pyx_GOTREF(__pyx_t_7);
29898 3602 : __pyx_r = __pyx_t_7;
29899 3602 : __pyx_t_7 = 0;
29900 3602 : goto __pyx_L0;
29901 :
29902 : /* "scipy/linalg/_decomp_update.pyx":1376
29903 : * raise ValueError('array must not contain infs or NaNs')
29904 : *
29905 : * if copy: # <<<<<<<<<<<<<<
29906 : * return PyArray_FromArray(a, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
29907 : * return a
29908 : */
29909 : }
29910 :
29911 : /* "scipy/linalg/_decomp_update.pyx":1378
29912 : * if copy:
29913 : * return PyArray_FromArray(a, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
29914 : * return a # <<<<<<<<<<<<<<
29915 : *
29916 : * cdef tuple validate_qr(object q0, object r0, bint overwrite_q, int q_order,
29917 : */
29918 68648 : __Pyx_XDECREF(__pyx_r);
29919 68648 : __Pyx_INCREF((PyObject *)__pyx_v_a);
29920 68648 : __pyx_r = ((PyObject *)__pyx_v_a);
29921 68648 : goto __pyx_L0;
29922 :
29923 : /* "scipy/linalg/_decomp_update.pyx":1358
29924 : * raise ValueError('q must be either F or C contiguous')
29925 : *
29926 : * cdef validate_array(cnp.ndarray a, bint chkfinite): # <<<<<<<<<<<<<<
29927 : * # here we check that a has positive strides and that its size is small
29928 : * # enough to fit in into an int, as BLAS/LAPACK require
29929 : */
29930 :
29931 : /* function exit code */
29932 132 : __pyx_L1_error:;
29933 132 : __Pyx_XDECREF(__pyx_t_7);
29934 132 : __Pyx_XDECREF(__pyx_t_8);
29935 132 : __Pyx_XDECREF(__pyx_t_9);
29936 132 : __Pyx_XDECREF(__pyx_t_10);
29937 132 : __Pyx_AddTraceback("scipy.linalg._decomp_update.validate_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
29938 132 : __pyx_r = 0;
29939 72382 : __pyx_L0:;
29940 72382 : __Pyx_XGIVEREF(__pyx_r);
29941 72382 : __Pyx_RefNannyFinishContext();
29942 72382 : return __pyx_r;
29943 : }
29944 :
29945 : /* "scipy/linalg/_decomp_update.pyx":1380
29946 : * return a
29947 : *
29948 : * cdef tuple validate_qr(object q0, object r0, bint overwrite_q, int q_order, # <<<<<<<<<<<<<<
29949 : * bint overwrite_r, int r_order, bint chkfinite):
29950 : * cdef cnp.ndarray Q
29951 : */
29952 :
29953 25178 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(PyObject *__pyx_v_q0, PyObject *__pyx_v_r0, int __pyx_v_overwrite_q, int __pyx_v_q_order, int __pyx_v_overwrite_r, int __pyx_v_r_order, int __pyx_v_chkfinite) {
29954 25178 : PyArrayObject *__pyx_v_Q = 0;
29955 25178 : PyArrayObject *__pyx_v_R = 0;
29956 25178 : int __pyx_v_typecode;
29957 25178 : int __pyx_v_economic;
29958 25178 : PyObject *__pyx_r = NULL;
29959 : __Pyx_RefNannyDeclarations
29960 25178 : int __pyx_t_1;
29961 25178 : PyObject *__pyx_t_2 = NULL;
29962 25178 : int __pyx_t_3;
29963 25178 : Py_ssize_t __pyx_t_4;
29964 25178 : Py_UCS4 __pyx_t_5;
29965 25178 : PyObject *__pyx_t_6 = NULL;
29966 25178 : PyObject *__pyx_t_7 = NULL;
29967 25178 : PyObject *__pyx_t_8 = NULL;
29968 25178 : PyObject *__pyx_t_9 = NULL;
29969 25178 : int __pyx_lineno = 0;
29970 25178 : const char *__pyx_filename = NULL;
29971 25178 : int __pyx_clineno = 0;
29972 25178 : __Pyx_RefNannySetupContext("validate_qr", 1);
29973 :
29974 : /* "scipy/linalg/_decomp_update.pyx":1385
29975 : * cdef cnp.ndarray R
29976 : * cdef int typecode
29977 : * cdef bint economic = False # <<<<<<<<<<<<<<
29978 : *
29979 : * q_order |= cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES
29980 : */
29981 25178 : __pyx_v_economic = 0;
29982 :
29983 : /* "scipy/linalg/_decomp_update.pyx":1387
29984 : * cdef bint economic = False
29985 : *
29986 : * q_order |= cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES # <<<<<<<<<<<<<<
29987 : * r_order |= cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES
29988 : *
29989 : */
29990 25178 : __pyx_v_q_order = (__pyx_v_q_order | (NPY_ARRAY_BEHAVED_NS | NPY_ARRAY_ELEMENTSTRIDES));
29991 :
29992 : /* "scipy/linalg/_decomp_update.pyx":1388
29993 : *
29994 : * q_order |= cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES
29995 : * r_order |= cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES # <<<<<<<<<<<<<<
29996 : *
29997 : * if not overwrite_q:
29998 : */
29999 25178 : __pyx_v_r_order = (__pyx_v_r_order | (NPY_ARRAY_BEHAVED_NS | NPY_ARRAY_ELEMENTSTRIDES));
30000 :
30001 : /* "scipy/linalg/_decomp_update.pyx":1390
30002 : * r_order |= cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES
30003 : *
30004 : * if not overwrite_q: # <<<<<<<<<<<<<<
30005 : * q_order |= cnp.NPY_ARRAY_ENSURECOPY
30006 : *
30007 : */
30008 25178 : __pyx_t_1 = (!__pyx_v_overwrite_q);
30009 25178 : if (__pyx_t_1) {
30010 :
30011 : /* "scipy/linalg/_decomp_update.pyx":1391
30012 : *
30013 : * if not overwrite_q:
30014 : * q_order |= cnp.NPY_ARRAY_ENSURECOPY # <<<<<<<<<<<<<<
30015 : *
30016 : * if not overwrite_r:
30017 : */
30018 3772 : __pyx_v_q_order = (__pyx_v_q_order | NPY_ARRAY_ENSURECOPY);
30019 :
30020 : /* "scipy/linalg/_decomp_update.pyx":1390
30021 : * r_order |= cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES
30022 : *
30023 : * if not overwrite_q: # <<<<<<<<<<<<<<
30024 : * q_order |= cnp.NPY_ARRAY_ENSURECOPY
30025 : *
30026 : */
30027 : }
30028 :
30029 : /* "scipy/linalg/_decomp_update.pyx":1393
30030 : * q_order |= cnp.NPY_ARRAY_ENSURECOPY
30031 : *
30032 : * if not overwrite_r: # <<<<<<<<<<<<<<
30033 : * r_order |= cnp.NPY_ARRAY_ENSURECOPY
30034 : *
30035 : */
30036 25178 : __pyx_t_1 = (!__pyx_v_overwrite_r);
30037 25178 : if (__pyx_t_1) {
30038 :
30039 : /* "scipy/linalg/_decomp_update.pyx":1394
30040 : *
30041 : * if not overwrite_r:
30042 : * r_order |= cnp.NPY_ARRAY_ENSURECOPY # <<<<<<<<<<<<<<
30043 : *
30044 : * # in the interests of giving better error messages take any number of
30045 : */
30046 3772 : __pyx_v_r_order = (__pyx_v_r_order | NPY_ARRAY_ENSURECOPY);
30047 :
30048 : /* "scipy/linalg/_decomp_update.pyx":1393
30049 : * q_order |= cnp.NPY_ARRAY_ENSURECOPY
30050 : *
30051 : * if not overwrite_r: # <<<<<<<<<<<<<<
30052 : * r_order |= cnp.NPY_ARRAY_ENSURECOPY
30053 : *
30054 : */
30055 : }
30056 :
30057 : /* "scipy/linalg/_decomp_update.pyx":1398
30058 : * # in the interests of giving better error messages take any number of
30059 : * # dimensions here.
30060 : * Q = PyArray_CheckFromAny(q0, NULL, 0, 0, q_order, NULL) # <<<<<<<<<<<<<<
30061 : * R = PyArray_CheckFromAny(r0, NULL, 0, 0, r_order, NULL)
30062 : *
30063 : */
30064 25178 : __pyx_t_2 = ((PyObject *)PyArray_CheckFromAny(__pyx_v_q0, NULL, 0, 0, __pyx_v_q_order, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error)
30065 25178 : __Pyx_GOTREF(__pyx_t_2);
30066 25178 : __pyx_v_Q = ((PyArrayObject *)__pyx_t_2);
30067 25178 : __pyx_t_2 = 0;
30068 :
30069 : /* "scipy/linalg/_decomp_update.pyx":1399
30070 : * # dimensions here.
30071 : * Q = PyArray_CheckFromAny(q0, NULL, 0, 0, q_order, NULL)
30072 : * R = PyArray_CheckFromAny(r0, NULL, 0, 0, r_order, NULL) # <<<<<<<<<<<<<<
30073 : *
30074 : * if Q.ndim != 2 or R.ndim != 2:
30075 : */
30076 25178 : __pyx_t_2 = ((PyObject *)PyArray_CheckFromAny(__pyx_v_r0, NULL, 0, 0, __pyx_v_r_order, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
30077 25178 : __Pyx_GOTREF(__pyx_t_2);
30078 25178 : __pyx_v_R = ((PyArrayObject *)__pyx_t_2);
30079 25178 : __pyx_t_2 = 0;
30080 :
30081 : /* "scipy/linalg/_decomp_update.pyx":1401
30082 : * R = PyArray_CheckFromAny(r0, NULL, 0, 0, r_order, NULL)
30083 : *
30084 : * if Q.ndim != 2 or R.ndim != 2: # <<<<<<<<<<<<<<
30085 : * raise ValueError('Q and R must be 2-D')
30086 : *
30087 : */
30088 25178 : __pyx_t_3 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_Q) != 2);
30089 25178 : if (!__pyx_t_3) {
30090 25142 : } else {
30091 36 : __pyx_t_1 = __pyx_t_3;
30092 36 : goto __pyx_L6_bool_binop_done;
30093 : }
30094 25142 : __pyx_t_3 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_R) != 2);
30095 25142 : __pyx_t_1 = __pyx_t_3;
30096 25178 : __pyx_L6_bool_binop_done:;
30097 25178 : if (unlikely(__pyx_t_1)) {
30098 :
30099 : /* "scipy/linalg/_decomp_update.pyx":1402
30100 : *
30101 : * if Q.ndim != 2 or R.ndim != 2:
30102 : * raise ValueError('Q and R must be 2-D') # <<<<<<<<<<<<<<
30103 : *
30104 : * typecode = cnp.PyArray_TYPE(Q)
30105 : */
30106 72 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __pyx_L1_error)
30107 72 : __Pyx_GOTREF(__pyx_t_2);
30108 72 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
30109 72 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30110 72 : __PYX_ERR(0, 1402, __pyx_L1_error)
30111 :
30112 : /* "scipy/linalg/_decomp_update.pyx":1401
30113 : * R = PyArray_CheckFromAny(r0, NULL, 0, 0, r_order, NULL)
30114 : *
30115 : * if Q.ndim != 2 or R.ndim != 2: # <<<<<<<<<<<<<<
30116 : * raise ValueError('Q and R must be 2-D')
30117 : *
30118 : */
30119 : }
30120 :
30121 : /* "scipy/linalg/_decomp_update.pyx":1404
30122 : * raise ValueError('Q and R must be 2-D')
30123 : *
30124 : * typecode = cnp.PyArray_TYPE(Q) # <<<<<<<<<<<<<<
30125 : *
30126 : * if typecode != cnp.PyArray_TYPE(R):
30127 : */
30128 25106 : __pyx_v_typecode = PyArray_TYPE(__pyx_v_Q);
30129 :
30130 : /* "scipy/linalg/_decomp_update.pyx":1406
30131 : * typecode = cnp.PyArray_TYPE(Q)
30132 : *
30133 : * if typecode != cnp.PyArray_TYPE(R): # <<<<<<<<<<<<<<
30134 : * raise ValueError('Q and R must have the same dtype')
30135 : *
30136 : */
30137 25106 : __pyx_t_1 = (__pyx_v_typecode != PyArray_TYPE(__pyx_v_R));
30138 25106 : if (unlikely(__pyx_t_1)) {
30139 :
30140 : /* "scipy/linalg/_decomp_update.pyx":1407
30141 : *
30142 : * if typecode != cnp.PyArray_TYPE(R):
30143 : * raise ValueError('Q and R must have the same dtype') # <<<<<<<<<<<<<<
30144 : *
30145 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE
30146 : */
30147 672 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
30148 672 : __Pyx_GOTREF(__pyx_t_2);
30149 672 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
30150 672 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30151 672 : __PYX_ERR(0, 1407, __pyx_L1_error)
30152 :
30153 : /* "scipy/linalg/_decomp_update.pyx":1406
30154 : * typecode = cnp.PyArray_TYPE(Q)
30155 : *
30156 : * if typecode != cnp.PyArray_TYPE(R): # <<<<<<<<<<<<<<
30157 : * raise ValueError('Q and R must have the same dtype')
30158 : *
30159 : */
30160 : }
30161 :
30162 : /* "scipy/linalg/_decomp_update.pyx":1409
30163 : * raise ValueError('Q and R must have the same dtype')
30164 : *
30165 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE # <<<<<<<<<<<<<<
30166 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
30167 : * raise ValueError('Only arrays with dtypes float32, float64, '
30168 : */
30169 24434 : switch (__pyx_v_typecode) {
30170 : case NPY_FLOAT:
30171 : case NPY_DOUBLE:
30172 : case NPY_CFLOAT:
30173 :
30174 : /* "scipy/linalg/_decomp_update.pyx":1410
30175 : *
30176 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE
30177 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE): # <<<<<<<<<<<<<<
30178 : * raise ValueError('Only arrays with dtypes float32, float64, '
30179 : * 'complex64, and complex128 are supported.')
30180 : */
30181 : case NPY_CDOUBLE:
30182 :
30183 : /* "scipy/linalg/_decomp_update.pyx":1409
30184 : * raise ValueError('Q and R must have the same dtype')
30185 : *
30186 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE # <<<<<<<<<<<<<<
30187 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
30188 : * raise ValueError('Only arrays with dtypes float32, float64, '
30189 : */
30190 : __pyx_t_1 = 1;
30191 : break;
30192 4 : default:
30193 4 : __pyx_t_1 = 0;
30194 4 : break;
30195 : }
30196 24434 : __pyx_t_3 = (!__pyx_t_1);
30197 24434 : if (unlikely(__pyx_t_3)) {
30198 :
30199 : /* "scipy/linalg/_decomp_update.pyx":1411
30200 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE
30201 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
30202 : * raise ValueError('Only arrays with dtypes float32, float64, ' # <<<<<<<<<<<<<<
30203 : * 'complex64, and complex128 are supported.')
30204 : *
30205 : */
30206 4 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
30207 4 : __Pyx_GOTREF(__pyx_t_2);
30208 4 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
30209 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30210 4 : __PYX_ERR(0, 1411, __pyx_L1_error)
30211 :
30212 : /* "scipy/linalg/_decomp_update.pyx":1409
30213 : * raise ValueError('Q and R must have the same dtype')
30214 : *
30215 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE # <<<<<<<<<<<<<<
30216 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
30217 : * raise ValueError('Only arrays with dtypes float32, float64, '
30218 : */
30219 : }
30220 :
30221 : /* "scipy/linalg/_decomp_update.pyx":1415
30222 : *
30223 : * # we support MxM MxN and MxN NxN
30224 : * if Q.shape[1] != R.shape[0]: # <<<<<<<<<<<<<<
30225 : * raise ValueError('Q and R do not have compatible shapes. Expected '
30226 : * '(M,M) (M,N) or (M,N) (N,N) but found %s %s for Q '
30227 : */
30228 24430 : __pyx_t_3 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_Q)[1]) != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_R)[0]));
30229 24430 : if (unlikely(__pyx_t_3)) {
30230 :
30231 : /* "scipy/linalg/_decomp_update.pyx":1416
30232 : * # we support MxM MxN and MxN NxN
30233 : * if Q.shape[1] != R.shape[0]:
30234 : * raise ValueError('Q and R do not have compatible shapes. Expected ' # <<<<<<<<<<<<<<
30235 : * '(M,M) (M,N) or (M,N) (N,N) but found %s %s for Q '
30236 : * 'and R respectively' %
30237 : */
30238 16 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
30239 16 : __Pyx_GOTREF(__pyx_t_2);
30240 16 : __pyx_t_4 = 0;
30241 16 : __pyx_t_5 = 127;
30242 16 : __Pyx_INCREF(__pyx_kp_u_Q_and_R_do_not_have_compatible_s);
30243 16 : __pyx_t_4 += 85;
30244 16 : __Pyx_GIVEREF(__pyx_kp_u_Q_and_R_do_not_have_compatible_s);
30245 16 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Q_and_R_do_not_have_compatible_s);
30246 :
30247 : /* "scipy/linalg/_decomp_update.pyx":1419
30248 : * '(M,M) (M,N) or (M,N) (N,N) but found %s %s for Q '
30249 : * 'and R respectively' %
30250 : * (str(getattr(Q, 'shape')), str(getattr(R, 'shape')))) # <<<<<<<<<<<<<<
30251 : *
30252 : * # so one or the other or both should be square.
30253 : */
30254 16 : __pyx_t_6 = __Pyx_GetAttr(((PyObject *)__pyx_v_Q), __pyx_n_u_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1419, __pyx_L1_error)
30255 16 : __Pyx_GOTREF(__pyx_t_6);
30256 16 : __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1419, __pyx_L1_error)
30257 16 : __Pyx_GOTREF(__pyx_t_7);
30258 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30259 16 : __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
30260 16 : __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
30261 16 : __Pyx_GIVEREF(__pyx_t_7);
30262 16 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
30263 16 : __pyx_t_7 = 0;
30264 16 : __Pyx_INCREF(__pyx_kp_u__13);
30265 16 : __pyx_t_4 += 1;
30266 16 : __Pyx_GIVEREF(__pyx_kp_u__13);
30267 16 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__13);
30268 16 : __pyx_t_7 = __Pyx_GetAttr(((PyObject *)__pyx_v_R), __pyx_n_u_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1419, __pyx_L1_error)
30269 16 : __Pyx_GOTREF(__pyx_t_7);
30270 16 : __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1419, __pyx_L1_error)
30271 16 : __Pyx_GOTREF(__pyx_t_6);
30272 16 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
30273 16 : __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
30274 16 : __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
30275 16 : __Pyx_GIVEREF(__pyx_t_6);
30276 16 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
30277 16 : __pyx_t_6 = 0;
30278 16 : __Pyx_INCREF(__pyx_kp_u_for_Q_and_R_respectively);
30279 16 : __pyx_t_4 += 25;
30280 16 : __Pyx_GIVEREF(__pyx_kp_u_for_Q_and_R_respectively);
30281 16 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_for_Q_and_R_respectively);
30282 :
30283 : /* "scipy/linalg/_decomp_update.pyx":1416
30284 : * # we support MxM MxN and MxN NxN
30285 : * if Q.shape[1] != R.shape[0]:
30286 : * raise ValueError('Q and R do not have compatible shapes. Expected ' # <<<<<<<<<<<<<<
30287 : * '(M,M) (M,N) or (M,N) (N,N) but found %s %s for Q '
30288 : * 'and R respectively' %
30289 : */
30290 16 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1416, __pyx_L1_error)
30291 16 : __Pyx_GOTREF(__pyx_t_6);
30292 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30293 16 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error)
30294 16 : __Pyx_GOTREF(__pyx_t_2);
30295 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30296 16 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
30297 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30298 16 : __PYX_ERR(0, 1416, __pyx_L1_error)
30299 :
30300 : /* "scipy/linalg/_decomp_update.pyx":1415
30301 : *
30302 : * # we support MxM MxN and MxN NxN
30303 : * if Q.shape[1] != R.shape[0]: # <<<<<<<<<<<<<<
30304 : * raise ValueError('Q and R do not have compatible shapes. Expected '
30305 : * '(M,M) (M,N) or (M,N) (N,N) but found %s %s for Q '
30306 : */
30307 : }
30308 :
30309 : /* "scipy/linalg/_decomp_update.pyx":1422
30310 : *
30311 : * # so one or the other or both should be square.
30312 : * if Q.shape[0] != Q.shape[1] and R.shape[0] == R.shape[1]: # <<<<<<<<<<<<<<
30313 : * economic = True
30314 : * elif Q.shape[0] != Q.shape[1]:
30315 : */
30316 24414 : __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_Q)[0]) != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_Q)[1]));
30317 24414 : if (__pyx_t_1) {
30318 920 : } else {
30319 23494 : __pyx_t_3 = __pyx_t_1;
30320 23494 : goto __pyx_L12_bool_binop_done;
30321 : }
30322 920 : __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_R)[0]) == (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_R)[1]));
30323 920 : __pyx_t_3 = __pyx_t_1;
30324 24414 : __pyx_L12_bool_binop_done:;
30325 24414 : if (__pyx_t_3) {
30326 :
30327 : /* "scipy/linalg/_decomp_update.pyx":1423
30328 : * # so one or the other or both should be square.
30329 : * if Q.shape[0] != Q.shape[1] and R.shape[0] == R.shape[1]:
30330 : * economic = True # <<<<<<<<<<<<<<
30331 : * elif Q.shape[0] != Q.shape[1]:
30332 : * raise ValueError('Expected (M,M) (M,N) or (M,N) (N,N) but found %s %s '
30333 : */
30334 908 : __pyx_v_economic = 1;
30335 :
30336 : /* "scipy/linalg/_decomp_update.pyx":1422
30337 : *
30338 : * # so one or the other or both should be square.
30339 : * if Q.shape[0] != Q.shape[1] and R.shape[0] == R.shape[1]: # <<<<<<<<<<<<<<
30340 : * economic = True
30341 : * elif Q.shape[0] != Q.shape[1]:
30342 : */
30343 908 : goto __pyx_L11;
30344 : }
30345 :
30346 : /* "scipy/linalg/_decomp_update.pyx":1424
30347 : * if Q.shape[0] != Q.shape[1] and R.shape[0] == R.shape[1]:
30348 : * economic = True
30349 : * elif Q.shape[0] != Q.shape[1]: # <<<<<<<<<<<<<<
30350 : * raise ValueError('Expected (M,M) (M,N) or (M,N) (N,N) but found %s %s '
30351 : * 'for Q and R respectively' %
30352 : */
30353 23506 : __pyx_t_3 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_Q)[0]) != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_Q)[1]));
30354 23506 : if (unlikely(__pyx_t_3)) {
30355 :
30356 : /* "scipy/linalg/_decomp_update.pyx":1425
30357 : * economic = True
30358 : * elif Q.shape[0] != Q.shape[1]:
30359 : * raise ValueError('Expected (M,M) (M,N) or (M,N) (N,N) but found %s %s ' # <<<<<<<<<<<<<<
30360 : * 'for Q and R respectively' %
30361 : * (str(getattr(Q, 'shape')), str(getattr(R, 'shape'))))
30362 : */
30363 12 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error)
30364 12 : __Pyx_GOTREF(__pyx_t_2);
30365 12 : __pyx_t_4 = 0;
30366 12 : __pyx_t_5 = 127;
30367 12 : __Pyx_INCREF(__pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but);
30368 12 : __pyx_t_4 += 46;
30369 12 : __Pyx_GIVEREF(__pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but);
30370 12 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but);
30371 :
30372 : /* "scipy/linalg/_decomp_update.pyx":1427
30373 : * raise ValueError('Expected (M,M) (M,N) or (M,N) (N,N) but found %s %s '
30374 : * 'for Q and R respectively' %
30375 : * (str(getattr(Q, 'shape')), str(getattr(R, 'shape')))) # <<<<<<<<<<<<<<
30376 : *
30377 : * Q = validate_array(Q, chkfinite)
30378 : */
30379 12 : __pyx_t_6 = __Pyx_GetAttr(((PyObject *)__pyx_v_Q), __pyx_n_u_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1427, __pyx_L1_error)
30380 12 : __Pyx_GOTREF(__pyx_t_6);
30381 12 : __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1427, __pyx_L1_error)
30382 12 : __Pyx_GOTREF(__pyx_t_7);
30383 12 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30384 12 : __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
30385 12 : __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
30386 12 : __Pyx_GIVEREF(__pyx_t_7);
30387 12 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
30388 12 : __pyx_t_7 = 0;
30389 12 : __Pyx_INCREF(__pyx_kp_u__13);
30390 12 : __pyx_t_4 += 1;
30391 12 : __Pyx_GIVEREF(__pyx_kp_u__13);
30392 12 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__13);
30393 12 : __pyx_t_7 = __Pyx_GetAttr(((PyObject *)__pyx_v_R), __pyx_n_u_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1427, __pyx_L1_error)
30394 12 : __Pyx_GOTREF(__pyx_t_7);
30395 12 : __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1427, __pyx_L1_error)
30396 12 : __Pyx_GOTREF(__pyx_t_6);
30397 12 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
30398 12 : __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
30399 12 : __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
30400 12 : __Pyx_GIVEREF(__pyx_t_6);
30401 12 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
30402 12 : __pyx_t_6 = 0;
30403 12 : __Pyx_INCREF(__pyx_kp_u_for_Q_and_R_respectively);
30404 12 : __pyx_t_4 += 25;
30405 12 : __Pyx_GIVEREF(__pyx_kp_u_for_Q_and_R_respectively);
30406 12 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_for_Q_and_R_respectively);
30407 :
30408 : /* "scipy/linalg/_decomp_update.pyx":1425
30409 : * economic = True
30410 : * elif Q.shape[0] != Q.shape[1]:
30411 : * raise ValueError('Expected (M,M) (M,N) or (M,N) (N,N) but found %s %s ' # <<<<<<<<<<<<<<
30412 : * 'for Q and R respectively' %
30413 : * (str(getattr(Q, 'shape')), str(getattr(R, 'shape'))))
30414 : */
30415 12 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1425, __pyx_L1_error)
30416 12 : __Pyx_GOTREF(__pyx_t_6);
30417 12 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30418 12 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error)
30419 12 : __Pyx_GOTREF(__pyx_t_2);
30420 12 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30421 12 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
30422 12 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30423 12 : __PYX_ERR(0, 1425, __pyx_L1_error)
30424 :
30425 : /* "scipy/linalg/_decomp_update.pyx":1424
30426 : * if Q.shape[0] != Q.shape[1] and R.shape[0] == R.shape[1]:
30427 : * economic = True
30428 : * elif Q.shape[0] != Q.shape[1]: # <<<<<<<<<<<<<<
30429 : * raise ValueError('Expected (M,M) (M,N) or (M,N) (N,N) but found %s %s '
30430 : * 'for Q and R respectively' %
30431 : */
30432 : }
30433 23494 : __pyx_L11:;
30434 :
30435 : /* "scipy/linalg/_decomp_update.pyx":1429
30436 : * (str(getattr(Q, 'shape')), str(getattr(R, 'shape'))))
30437 : *
30438 : * Q = validate_array(Q, chkfinite) # <<<<<<<<<<<<<<
30439 : * R = validate_array(R, chkfinite)
30440 : *
30441 : */
30442 24402 : __pyx_t_2 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_Q, __pyx_v_chkfinite); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error)
30443 24354 : __Pyx_GOTREF(__pyx_t_2);
30444 24354 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1429, __pyx_L1_error)
30445 24354 : __Pyx_DECREF_SET(__pyx_v_Q, ((PyArrayObject *)__pyx_t_2));
30446 24354 : __pyx_t_2 = 0;
30447 :
30448 : /* "scipy/linalg/_decomp_update.pyx":1430
30449 : *
30450 : * Q = validate_array(Q, chkfinite)
30451 : * R = validate_array(R, chkfinite) # <<<<<<<<<<<<<<
30452 : *
30453 : * return Q, R, typecode, Q.shape[0], R.shape[1], economic
30454 : */
30455 24354 : __pyx_t_2 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_R, __pyx_v_chkfinite); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
30456 24306 : __Pyx_GOTREF(__pyx_t_2);
30457 24306 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1430, __pyx_L1_error)
30458 24306 : __Pyx_DECREF_SET(__pyx_v_R, ((PyArrayObject *)__pyx_t_2));
30459 24306 : __pyx_t_2 = 0;
30460 :
30461 : /* "scipy/linalg/_decomp_update.pyx":1432
30462 : * R = validate_array(R, chkfinite)
30463 : *
30464 : * return Q, R, typecode, Q.shape[0], R.shape[1], economic # <<<<<<<<<<<<<<
30465 : *
30466 : * cdef void* extract(cnp.ndarray arr, int* arrs) noexcept:
30467 : */
30468 24306 : __Pyx_XDECREF(__pyx_r);
30469 24306 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_typecode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error)
30470 24306 : __Pyx_GOTREF(__pyx_t_2);
30471 24306 : __pyx_t_6 = __Pyx_PyInt_From_npy_intp((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_Q)[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1432, __pyx_L1_error)
30472 24306 : __Pyx_GOTREF(__pyx_t_6);
30473 24306 : __pyx_t_7 = __Pyx_PyInt_From_npy_intp((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_R)[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1432, __pyx_L1_error)
30474 24306 : __Pyx_GOTREF(__pyx_t_7);
30475 24306 : __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_economic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error)
30476 24306 : __Pyx_GOTREF(__pyx_t_8);
30477 24306 : __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1432, __pyx_L1_error)
30478 24306 : __Pyx_GOTREF(__pyx_t_9);
30479 24306 : __Pyx_INCREF((PyObject *)__pyx_v_Q);
30480 24306 : __Pyx_GIVEREF((PyObject *)__pyx_v_Q);
30481 24306 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_Q))) __PYX_ERR(0, 1432, __pyx_L1_error);
30482 24306 : __Pyx_INCREF((PyObject *)__pyx_v_R);
30483 24306 : __Pyx_GIVEREF((PyObject *)__pyx_v_R);
30484 24306 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_R))) __PYX_ERR(0, 1432, __pyx_L1_error);
30485 24306 : __Pyx_GIVEREF(__pyx_t_2);
30486 24306 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error);
30487 24306 : __Pyx_GIVEREF(__pyx_t_6);
30488 24306 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_6)) __PYX_ERR(0, 1432, __pyx_L1_error);
30489 24306 : __Pyx_GIVEREF(__pyx_t_7);
30490 24306 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_7)) __PYX_ERR(0, 1432, __pyx_L1_error);
30491 24306 : __Pyx_GIVEREF(__pyx_t_8);
30492 24306 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error);
30493 24306 : __pyx_t_2 = 0;
30494 24306 : __pyx_t_6 = 0;
30495 24306 : __pyx_t_7 = 0;
30496 24306 : __pyx_t_8 = 0;
30497 24306 : __pyx_r = ((PyObject*)__pyx_t_9);
30498 24306 : __pyx_t_9 = 0;
30499 24306 : goto __pyx_L0;
30500 :
30501 : /* "scipy/linalg/_decomp_update.pyx":1380
30502 : * return a
30503 : *
30504 : * cdef tuple validate_qr(object q0, object r0, bint overwrite_q, int q_order, # <<<<<<<<<<<<<<
30505 : * bint overwrite_r, int r_order, bint chkfinite):
30506 : * cdef cnp.ndarray Q
30507 : */
30508 :
30509 : /* function exit code */
30510 872 : __pyx_L1_error:;
30511 872 : __Pyx_XDECREF(__pyx_t_2);
30512 872 : __Pyx_XDECREF(__pyx_t_6);
30513 872 : __Pyx_XDECREF(__pyx_t_7);
30514 872 : __Pyx_XDECREF(__pyx_t_8);
30515 872 : __Pyx_XDECREF(__pyx_t_9);
30516 872 : __Pyx_AddTraceback("scipy.linalg._decomp_update.validate_qr", __pyx_clineno, __pyx_lineno, __pyx_filename);
30517 872 : __pyx_r = 0;
30518 25178 : __pyx_L0:;
30519 25178 : __Pyx_XDECREF((PyObject *)__pyx_v_Q);
30520 25178 : __Pyx_XDECREF((PyObject *)__pyx_v_R);
30521 25178 : __Pyx_XGIVEREF(__pyx_r);
30522 25178 : __Pyx_RefNannyFinishContext();
30523 25178 : return __pyx_r;
30524 : }
30525 :
30526 : /* "scipy/linalg/_decomp_update.pyx":1434
30527 : * return Q, R, typecode, Q.shape[0], R.shape[1], economic
30528 : *
30529 : * cdef void* extract(cnp.ndarray arr, int* arrs) noexcept: # <<<<<<<<<<<<<<
30530 : * with cython.cdivision(True): # Assumes itemsize != 0.
30531 : * if arr.ndim == 2:
30532 : */
30533 :
30534 91696 : static void *__pyx_f_5scipy_6linalg_14_decomp_update_extract(PyArrayObject *__pyx_v_arr, int *__pyx_v_arrs) {
30535 91696 : void *__pyx_r;
30536 91696 : int __pyx_t_1;
30537 :
30538 : /* "scipy/linalg/_decomp_update.pyx":1436
30539 : * cdef void* extract(cnp.ndarray arr, int* arrs) noexcept:
30540 : * with cython.cdivision(True): # Assumes itemsize != 0.
30541 : * if arr.ndim == 2: # <<<<<<<<<<<<<<
30542 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30543 : * arrs[1] = arr.strides[1] / cnp.PyArray_ITEMSIZE(arr)
30544 : */
30545 91696 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr) == 2);
30546 91696 : if (__pyx_t_1) {
30547 :
30548 : /* "scipy/linalg/_decomp_update.pyx":1437
30549 : * with cython.cdivision(True): # Assumes itemsize != 0.
30550 : * if arr.ndim == 2:
30551 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr) # <<<<<<<<<<<<<<
30552 : * arrs[1] = arr.strides[1] / cnp.PyArray_ITEMSIZE(arr)
30553 : * elif arr.ndim == 1:
30554 : */
30555 70962 : (__pyx_v_arrs[0]) = ((__pyx_f_5numpy_7ndarray_7strides_strides(__pyx_v_arr)[0]) / PyArray_ITEMSIZE(__pyx_v_arr));
30556 :
30557 : /* "scipy/linalg/_decomp_update.pyx":1438
30558 : * if arr.ndim == 2:
30559 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30560 : * arrs[1] = arr.strides[1] / cnp.PyArray_ITEMSIZE(arr) # <<<<<<<<<<<<<<
30561 : * elif arr.ndim == 1:
30562 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30563 : */
30564 70962 : (__pyx_v_arrs[1]) = ((__pyx_f_5numpy_7ndarray_7strides_strides(__pyx_v_arr)[1]) / PyArray_ITEMSIZE(__pyx_v_arr));
30565 :
30566 : /* "scipy/linalg/_decomp_update.pyx":1436
30567 : * cdef void* extract(cnp.ndarray arr, int* arrs) noexcept:
30568 : * with cython.cdivision(True): # Assumes itemsize != 0.
30569 : * if arr.ndim == 2: # <<<<<<<<<<<<<<
30570 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30571 : * arrs[1] = arr.strides[1] / cnp.PyArray_ITEMSIZE(arr)
30572 : */
30573 70962 : goto __pyx_L3;
30574 : }
30575 :
30576 : /* "scipy/linalg/_decomp_update.pyx":1439
30577 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30578 : * arrs[1] = arr.strides[1] / cnp.PyArray_ITEMSIZE(arr)
30579 : * elif arr.ndim == 1: # <<<<<<<<<<<<<<
30580 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30581 : * arrs[1] = 0
30582 : */
30583 20734 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_arr) == 1);
30584 20734 : if (__pyx_t_1) {
30585 :
30586 : /* "scipy/linalg/_decomp_update.pyx":1440
30587 : * arrs[1] = arr.strides[1] / cnp.PyArray_ITEMSIZE(arr)
30588 : * elif arr.ndim == 1:
30589 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr) # <<<<<<<<<<<<<<
30590 : * arrs[1] = 0
30591 : * return cnp.PyArray_DATA(arr)
30592 : */
30593 20734 : (__pyx_v_arrs[0]) = ((__pyx_f_5numpy_7ndarray_7strides_strides(__pyx_v_arr)[0]) / PyArray_ITEMSIZE(__pyx_v_arr));
30594 :
30595 : /* "scipy/linalg/_decomp_update.pyx":1441
30596 : * elif arr.ndim == 1:
30597 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30598 : * arrs[1] = 0 # <<<<<<<<<<<<<<
30599 : * return cnp.PyArray_DATA(arr)
30600 : *
30601 : */
30602 20734 : (__pyx_v_arrs[1]) = 0;
30603 :
30604 : /* "scipy/linalg/_decomp_update.pyx":1439
30605 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30606 : * arrs[1] = arr.strides[1] / cnp.PyArray_ITEMSIZE(arr)
30607 : * elif arr.ndim == 1: # <<<<<<<<<<<<<<
30608 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30609 : * arrs[1] = 0
30610 : */
30611 : }
30612 0 : __pyx_L3:;
30613 :
30614 : /* "scipy/linalg/_decomp_update.pyx":1442
30615 : * arrs[0] = arr.strides[0] / cnp.PyArray_ITEMSIZE(arr)
30616 : * arrs[1] = 0
30617 : * return cnp.PyArray_DATA(arr) # <<<<<<<<<<<<<<
30618 : *
30619 : * @cython.embedsignature(True)
30620 : */
30621 91696 : __pyx_r = PyArray_DATA(__pyx_v_arr);
30622 91696 : goto __pyx_L0;
30623 :
30624 : /* "scipy/linalg/_decomp_update.pyx":1434
30625 : * return Q, R, typecode, Q.shape[0], R.shape[1], economic
30626 : *
30627 : * cdef void* extract(cnp.ndarray arr, int* arrs) noexcept: # <<<<<<<<<<<<<<
30628 : * with cython.cdivision(True): # Assumes itemsize != 0.
30629 : * if arr.ndim == 2:
30630 : */
30631 :
30632 : /* function exit code */
30633 91696 : __pyx_L0:;
30634 91696 : return __pyx_r;
30635 : }
30636 :
30637 : /* "scipy/linalg/_decomp_update.pyx":1444
30638 : * return cnp.PyArray_DATA(arr)
30639 : *
30640 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
30641 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False,
30642 : * check_finite=True):
30643 : */
30644 :
30645 : /* Python wrapper */
30646 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_3qr_delete(PyObject *__pyx_self,
30647 : #if CYTHON_METH_FASTCALL
30648 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
30649 : #else
30650 : PyObject *__pyx_args, PyObject *__pyx_kwds
30651 : #endif
30652 : ); /*proto*/
30653 : PyDoc_STRVAR(__pyx_doc_5scipy_6linalg_14_decomp_update_2qr_delete, "qr_delete(Q, R, k, int p=1, which=u'row', overwrite_qr=False, check_finite=True)\n\n QR downdate on row or column deletions\n\n If ``A = Q R`` is the QR factorization of ``A``, return the QR\n factorization of ``A`` where ``p`` rows or columns have been removed\n starting at row or column ``k``.\n\n Parameters\n ----------\n Q : (M, M) or (M, N) array_like\n Unitary/orthogonal matrix from QR decomposition.\n R : (M, N) or (N, N) array_like\n Upper triangular matrix from QR decomposition.\n k : int\n Index of the first row or column to delete.\n p : int, optional\n Number of rows or columns to delete, defaults to 1.\n which: {'row', 'col'}, optional\n Determines if rows or columns will be deleted, defaults to 'row'\n overwrite_qr : bool, optional\n If True, consume Q and R, overwriting their contents with their\n downdated versions, and returning appropriately sized views.\n Defaults to False.\n check_finite : bool, optional\n Whether to check that the input matrix contains only finite numbers.\n Disabling may give a performance gain, but may result in problems\n (crashes, non-termination) if the inputs do contain infinities or NaNs.\n Default is True.\n\n Returns\n -------\n Q1 : ndarray\n Updated unitary/orthogonal factor\n R1 : ndarray\n Updated upper triangular factor\n\n See Also\n --------\n qr, qr_multiply, qr_insert, qr_update\n\n Notes\n -----\n This routine does not guarantee that the diagonal entries of ``R1`` are\n positive.\n\n .. versionadded:: 0.16.0\n\n References\n ----------\n .. [1] Golub, G. H. & Van Loan, C. F. Matrix Computations, 3rd Ed.\n (Johns Hopkins University Press, 1996).\n\n .. [2] Daniel, J. W., Gragg, W. B., Kaufman, L. & Stewart, G. W.\n Reorthogonalization and stable algorithms for updating the\n Gram-Schmidt QR factoriza""tion. Math. Comput. 30, 772-795 (1976).\n\n .. [3] Reichel, L. & Gragg, W. B. Algorithm 686: FORTRAN Subroutines for\n Updating the QR Decomposition. ACM Trans. Math. Softw. 16, 369-377\n (1990).\n\n Examples\n --------\n >>> import numpy as np\n >>> from scipy import linalg\n >>> a = np.array([[ 3., -2., -2.],\n ... [ 6., -9., -3.],\n ... [ -3., 10., 1.],\n ... [ 6., -7., 4.],\n ... [ 7., 8., -6.]])\n >>> q, r = linalg.qr(a)\n\n Given this QR decomposition, update q and r when 2 rows are removed.\n\n >>> q1, r1 = linalg.qr_delete(q, r, 2, 2, 'row', False)\n >>> q1\n array([[ 0.30942637, 0.15347579, 0.93845645], # may vary (signs)\n [ 0.61885275, 0.71680171, -0.32127338],\n [ 0.72199487, -0.68017681, -0.12681844]])\n >>> r1\n array([[ 9.69535971, -0.4125685 , -6.80738023], # may vary (signs)\n [ 0. , -12.19958144, 1.62370412],\n [ 0. , 0. , -0.15218213]])\n\n The update is equivalent, but faster than the following.\n\n >>> a1 = np.delete(a, slice(2,4), 0)\n >>> a1\n array([[ 3., -2., -2.],\n [ 6., -9., -3.],\n [ 7., 8., -6.]])\n >>> q_direct, r_direct = linalg.qr(a1)\n\n Check that we have equivalent results:\n\n >>> np.dot(q1, r1)\n array([[ 3., -2., -2.],\n [ 6., -9., -3.],\n [ 7., 8., -6.]])\n >>> np.allclose(np.dot(q1, r1), a1)\n True\n\n And the updated Q is still unitary:\n\n >>> np.allclose(np.dot(q1.T, q1), np.eye(3))\n True\n\n ");
30654 : static PyMethodDef __pyx_mdef_5scipy_6linalg_14_decomp_update_3qr_delete = {"qr_delete", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_14_decomp_update_3qr_delete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6linalg_14_decomp_update_2qr_delete};
30655 3000 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_3qr_delete(PyObject *__pyx_self,
30656 : #if CYTHON_METH_FASTCALL
30657 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
30658 : #else
30659 : PyObject *__pyx_args, PyObject *__pyx_kwds
30660 : #endif
30661 : ) {
30662 3000 : PyObject *__pyx_v_Q = 0;
30663 3000 : PyObject *__pyx_v_R = 0;
30664 3000 : PyObject *__pyx_v_k = 0;
30665 3000 : int __pyx_v_p;
30666 3000 : PyObject *__pyx_v_which = 0;
30667 3000 : PyObject *__pyx_v_overwrite_qr = 0;
30668 3000 : PyObject *__pyx_v_check_finite = 0;
30669 : #if !CYTHON_METH_FASTCALL
30670 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
30671 : #endif
30672 3000 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
30673 3000 : PyObject* values[7] = {0,0,0,0,0,0,0};
30674 3000 : int __pyx_lineno = 0;
30675 3000 : const char *__pyx_filename = NULL;
30676 3000 : int __pyx_clineno = 0;
30677 3000 : PyObject *__pyx_r = 0;
30678 : __Pyx_RefNannyDeclarations
30679 3000 : __Pyx_RefNannySetupContext("qr_delete (wrapper)", 0);
30680 : #if !CYTHON_METH_FASTCALL
30681 : #if CYTHON_ASSUME_SAFE_MACROS
30682 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
30683 : #else
30684 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
30685 : #endif
30686 : #endif
30687 3000 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
30688 : {
30689 3000 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Q,&__pyx_n_s_R,&__pyx_n_s_k,&__pyx_n_s_p,&__pyx_n_s_which,&__pyx_n_s_overwrite_qr,&__pyx_n_s_check_finite,0};
30690 3000 : values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_row)));
30691 :
30692 : /* "scipy/linalg/_decomp_update.pyx":1445
30693 : *
30694 : * @cython.embedsignature(True)
30695 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False, # <<<<<<<<<<<<<<
30696 : * check_finite=True):
30697 : * """
30698 : */
30699 3000 : values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
30700 :
30701 : /* "scipy/linalg/_decomp_update.pyx":1446
30702 : * @cython.embedsignature(True)
30703 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False,
30704 : * check_finite=True): # <<<<<<<<<<<<<<
30705 : * """
30706 : * QR downdate on row or column deletions
30707 : */
30708 3000 : values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True)));
30709 3000 : if (__pyx_kwds) {
30710 1260 : Py_ssize_t kw_args;
30711 1260 : switch (__pyx_nargs) {
30712 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
30713 0 : CYTHON_FALLTHROUGH;
30714 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
30715 32 : CYTHON_FALLTHROUGH;
30716 32 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
30717 916 : CYTHON_FALLTHROUGH;
30718 916 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
30719 1260 : CYTHON_FALLTHROUGH;
30720 1260 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
30721 1260 : CYTHON_FALLTHROUGH;
30722 1260 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
30723 1260 : CYTHON_FALLTHROUGH;
30724 1260 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
30725 1260 : CYTHON_FALLTHROUGH;
30726 1260 : case 0: break;
30727 0 : default: goto __pyx_L5_argtuple_error;
30728 : }
30729 1260 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
30730 1260 : switch (__pyx_nargs) {
30731 0 : case 0:
30732 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_Q)) != 0)) {
30733 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
30734 0 : kw_args--;
30735 : }
30736 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
30737 0 : else goto __pyx_L5_argtuple_error;
30738 0 : CYTHON_FALLTHROUGH;
30739 : case 1:
30740 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) {
30741 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
30742 0 : kw_args--;
30743 : }
30744 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
30745 : else {
30746 0 : __Pyx_RaiseArgtupleInvalid("qr_delete", 0, 3, 7, 1); __PYX_ERR(0, 1444, __pyx_L3_error)
30747 : }
30748 0 : CYTHON_FALLTHROUGH;
30749 : case 2:
30750 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
30751 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
30752 0 : kw_args--;
30753 : }
30754 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
30755 : else {
30756 0 : __Pyx_RaiseArgtupleInvalid("qr_delete", 0, 3, 7, 2); __PYX_ERR(0, 1444, __pyx_L3_error)
30757 : }
30758 344 : CYTHON_FALLTHROUGH;
30759 : case 3:
30760 344 : if (kw_args > 0) {
30761 344 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p);
30762 344 : if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
30763 344 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
30764 : }
30765 1228 : CYTHON_FALLTHROUGH;
30766 : case 4:
30767 1228 : if (kw_args > 0) {
30768 1228 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_which);
30769 1228 : if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
30770 664 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
30771 : }
30772 1260 : CYTHON_FALLTHROUGH;
30773 : case 5:
30774 1260 : if (kw_args > 0) {
30775 1256 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overwrite_qr);
30776 1256 : if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
30777 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
30778 : }
30779 1256 : CYTHON_FALLTHROUGH;
30780 : case 6:
30781 1256 : if (kw_args > 0) {
30782 0 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_finite);
30783 0 : if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
30784 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error)
30785 : }
30786 : }
30787 1260 : if (unlikely(kw_args > 0)) {
30788 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
30789 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "qr_delete") < 0)) __PYX_ERR(0, 1444, __pyx_L3_error)
30790 : }
30791 : } else {
30792 1740 : switch (__pyx_nargs) {
30793 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
30794 1220 : CYTHON_FALLTHROUGH;
30795 1220 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
30796 1708 : CYTHON_FALLTHROUGH;
30797 1708 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
30798 1740 : CYTHON_FALLTHROUGH;
30799 1740 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
30800 1740 : CYTHON_FALLTHROUGH;
30801 1740 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
30802 1740 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
30803 1740 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
30804 1740 : break;
30805 0 : default: goto __pyx_L5_argtuple_error;
30806 : }
30807 : }
30808 3000 : __pyx_v_Q = values[0];
30809 3000 : __pyx_v_R = values[1];
30810 3000 : __pyx_v_k = values[2];
30811 3000 : if (values[3]) {
30812 2656 : __pyx_v_p = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_p == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1445, __pyx_L3_error)
30813 : } else {
30814 : __pyx_v_p = ((int)((int)1));
30815 : }
30816 3000 : __pyx_v_which = values[4];
30817 3000 : __pyx_v_overwrite_qr = values[5];
30818 3000 : __pyx_v_check_finite = values[6];
30819 : }
30820 3000 : goto __pyx_L6_skip;
30821 0 : __pyx_L5_argtuple_error:;
30822 0 : __Pyx_RaiseArgtupleInvalid("qr_delete", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 1444, __pyx_L3_error)
30823 3000 : __pyx_L6_skip:;
30824 3000 : goto __pyx_L4_argument_unpacking_done;
30825 0 : __pyx_L3_error:;
30826 : {
30827 0 : Py_ssize_t __pyx_temp;
30828 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
30829 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
30830 : }
30831 : }
30832 0 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
30833 0 : __Pyx_RefNannyFinishContext();
30834 0 : return NULL;
30835 3000 : __pyx_L4_argument_unpacking_done:;
30836 3000 : __pyx_r = __pyx_pf_5scipy_6linalg_14_decomp_update_2qr_delete(__pyx_self, __pyx_v_Q, __pyx_v_R, __pyx_v_k, __pyx_v_p, __pyx_v_which, __pyx_v_overwrite_qr, __pyx_v_check_finite);
30837 :
30838 : /* "scipy/linalg/_decomp_update.pyx":1444
30839 : * return cnp.PyArray_DATA(arr)
30840 : *
30841 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
30842 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False,
30843 : * check_finite=True):
30844 : */
30845 :
30846 : /* function exit code */
30847 : {
30848 3000 : Py_ssize_t __pyx_temp;
30849 3000 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
30850 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
30851 : }
30852 : }
30853 : __Pyx_RefNannyFinishContext();
30854 : return __pyx_r;
30855 : }
30856 :
30857 3000 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update_2qr_delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_k, int __pyx_v_p, PyObject *__pyx_v_which, PyObject *__pyx_v_overwrite_qr, PyObject *__pyx_v_check_finite) {
30858 3000 : PyArrayObject *__pyx_v_q1 = 0;
30859 3000 : PyArrayObject *__pyx_v_r1 = 0;
30860 3000 : int __pyx_v_k1;
30861 3000 : int __pyx_v_p1;
30862 3000 : int __pyx_v_p_eco;
30863 3000 : int __pyx_v_p_full;
30864 3000 : int __pyx_v_typecode;
30865 3000 : int __pyx_v_m;
30866 3000 : int __pyx_v_n;
30867 3000 : int __pyx_v_info;
30868 3000 : void *__pyx_v_qptr;
30869 3000 : void *__pyx_v_rptr;
30870 3000 : int __pyx_v_qs[2];
30871 3000 : int __pyx_v_rs[2];
30872 3000 : int __pyx_v_economic;
30873 3000 : int __pyx_v_qisF;
30874 3000 : int __pyx_v_chkfinite;
30875 3000 : int __pyx_v_overwrite;
30876 3000 : PyObject *__pyx_v_qnew = NULL;
30877 3000 : PyObject *__pyx_v_norm = NULL;
30878 3000 : int __pyx_v_o;
30879 3000 : PyObject *__pyx_r = NULL;
30880 : __Pyx_RefNannyDeclarations
30881 3000 : int __pyx_t_1;
30882 3000 : int __pyx_t_2;
30883 3000 : PyObject *__pyx_t_3 = NULL;
30884 3000 : PyObject *__pyx_t_4 = NULL;
30885 3000 : PyObject *__pyx_t_5 = NULL;
30886 3000 : PyObject *__pyx_t_6 = NULL;
30887 3000 : PyObject *__pyx_t_7 = NULL;
30888 3000 : PyObject *__pyx_t_8 = NULL;
30889 3000 : PyObject *__pyx_t_9 = NULL;
30890 3000 : int __pyx_t_10;
30891 3000 : int __pyx_t_11;
30892 3000 : int __pyx_t_12;
30893 3000 : unsigned int __pyx_t_13;
30894 3000 : int __pyx_lineno = 0;
30895 3000 : const char *__pyx_filename = NULL;
30896 3000 : int __pyx_clineno = 0;
30897 3000 : __Pyx_RefNannySetupContext("qr_delete", 1);
30898 :
30899 : /* "scipy/linalg/_decomp_update.pyx":1555
30900 : * """
30901 : * cdef cnp.ndarray q1, r1
30902 : * cdef int k1 = k # <<<<<<<<<<<<<<
30903 : * cdef int p1 = p
30904 : * cdef int p_eco, p_full
30905 : */
30906 3000 : __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1555, __pyx_L1_error)
30907 3000 : __pyx_v_k1 = __pyx_t_1;
30908 :
30909 : /* "scipy/linalg/_decomp_update.pyx":1556
30910 : * cdef cnp.ndarray q1, r1
30911 : * cdef int k1 = k
30912 : * cdef int p1 = p # <<<<<<<<<<<<<<
30913 : * cdef int p_eco, p_full
30914 : * cdef int typecode, m, n, info
30915 : */
30916 3000 : __pyx_v_p1 = __pyx_v_p;
30917 :
30918 : /* "scipy/linalg/_decomp_update.pyx":1563
30919 : * cdef int qs[2]
30920 : * cdef int rs[2]
30921 : * cdef bint economic, qisF = False # <<<<<<<<<<<<<<
30922 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qr
30923 : *
30924 : */
30925 3000 : __pyx_v_qisF = 0;
30926 :
30927 : /* "scipy/linalg/_decomp_update.pyx":1564
30928 : * cdef int rs[2]
30929 : * cdef bint economic, qisF = False
30930 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qr # <<<<<<<<<<<<<<
30931 : *
30932 : * if which == 'row':
30933 : */
30934 3000 : __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_check_finite); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L1_error)
30935 3000 : __pyx_v_chkfinite = __pyx_t_2;
30936 3000 : __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_qr); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1564, __pyx_L1_error)
30937 3000 : __pyx_v_overwrite = __pyx_t_2;
30938 :
30939 : /* "scipy/linalg/_decomp_update.pyx":1566
30940 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qr
30941 : *
30942 : * if which == 'row': # <<<<<<<<<<<<<<
30943 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
30944 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
30945 : */
30946 3000 : __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_which, __pyx_n_u_row, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1566, __pyx_L1_error)
30947 3000 : if (__pyx_t_2) {
30948 :
30949 : /* "scipy/linalg/_decomp_update.pyx":1567
30950 : *
30951 : * if which == 'row':
30952 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite, # <<<<<<<<<<<<<<
30953 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
30954 : * if not (-m <= k1 < m):
30955 : */
30956 1568 : __pyx_t_3 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(__pyx_v_Q, __pyx_v_R, __pyx_v_overwrite, 0, __pyx_v_overwrite, 0, __pyx_v_chkfinite); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1567, __pyx_L1_error)
30957 1340 : __Pyx_GOTREF(__pyx_t_3);
30958 1340 : if (likely(__pyx_t_3 != Py_None)) {
30959 1340 : PyObject* sequence = __pyx_t_3;
30960 1340 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
30961 1340 : if (unlikely(size != 6)) {
30962 0 : if (size > 6) __Pyx_RaiseTooManyValuesError(6);
30963 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
30964 0 : __PYX_ERR(0, 1567, __pyx_L1_error)
30965 : }
30966 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30967 1340 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
30968 1340 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
30969 1340 : __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
30970 1340 : __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
30971 1340 : __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
30972 1340 : __pyx_t_9 = PyTuple_GET_ITEM(sequence, 5);
30973 1340 : __Pyx_INCREF(__pyx_t_4);
30974 1340 : __Pyx_INCREF(__pyx_t_5);
30975 1340 : __Pyx_INCREF(__pyx_t_6);
30976 1340 : __Pyx_INCREF(__pyx_t_7);
30977 1340 : __Pyx_INCREF(__pyx_t_8);
30978 1340 : __Pyx_INCREF(__pyx_t_9);
30979 : #else
30980 : {
30981 : Py_ssize_t i;
30982 : PyObject** temps[6] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
30983 : for (i=0; i < 6; i++) {
30984 : PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1567, __pyx_L1_error)
30985 : __Pyx_GOTREF(item);
30986 : *(temps[i]) = item;
30987 : }
30988 : }
30989 : #endif
30990 1340 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30991 : } else {
30992 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1567, __pyx_L1_error)
30993 : }
30994 1340 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1567, __pyx_L1_error)
30995 1340 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1567, __pyx_L1_error)
30996 1340 : __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1567, __pyx_L1_error)
30997 1340 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30998 1340 : __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1567, __pyx_L1_error)
30999 1340 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31000 1340 : __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1567, __pyx_L1_error)
31001 1340 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31002 1340 : __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1567, __pyx_L1_error)
31003 1340 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31004 1340 : __pyx_v_q1 = ((PyArrayObject *)__pyx_t_4);
31005 1340 : __pyx_t_4 = 0;
31006 1340 : __pyx_v_r1 = ((PyArrayObject *)__pyx_t_5);
31007 1340 : __pyx_t_5 = 0;
31008 1340 : __pyx_v_typecode = __pyx_t_1;
31009 1340 : __pyx_v_m = __pyx_t_10;
31010 1340 : __pyx_v_n = __pyx_t_11;
31011 1340 : __pyx_v_economic = __pyx_t_2;
31012 :
31013 : /* "scipy/linalg/_decomp_update.pyx":1569
31014 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
31015 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
31016 : * if not (-m <= k1 < m): # <<<<<<<<<<<<<<
31017 : * raise ValueError("'k' is out of bounds")
31018 : * if k1 < 0:
31019 : */
31020 1340 : __pyx_t_2 = ((-__pyx_v_m) <= __pyx_v_k1);
31021 1340 : if (__pyx_t_2) {
31022 1336 : __pyx_t_2 = (__pyx_v_k1 < __pyx_v_m);
31023 : }
31024 1340 : __pyx_t_12 = (!__pyx_t_2);
31025 1340 : if (unlikely(__pyx_t_12)) {
31026 :
31027 : /* "scipy/linalg/_decomp_update.pyx":1570
31028 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
31029 : * if not (-m <= k1 < m):
31030 : * raise ValueError("'k' is out of bounds") # <<<<<<<<<<<<<<
31031 : * if k1 < 0:
31032 : * k1 += m
31033 : */
31034 8 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
31035 8 : __Pyx_GOTREF(__pyx_t_3);
31036 8 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
31037 8 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31038 8 : __PYX_ERR(0, 1570, __pyx_L1_error)
31039 :
31040 : /* "scipy/linalg/_decomp_update.pyx":1569
31041 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
31042 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
31043 : * if not (-m <= k1 < m): # <<<<<<<<<<<<<<
31044 : * raise ValueError("'k' is out of bounds")
31045 : * if k1 < 0:
31046 : */
31047 : }
31048 :
31049 : /* "scipy/linalg/_decomp_update.pyx":1571
31050 : * if not (-m <= k1 < m):
31051 : * raise ValueError("'k' is out of bounds")
31052 : * if k1 < 0: # <<<<<<<<<<<<<<
31053 : * k1 += m
31054 : * if k1 + p1 > m or p1 <= 0:
31055 : */
31056 1332 : __pyx_t_12 = (__pyx_v_k1 < 0);
31057 1332 : if (__pyx_t_12) {
31058 :
31059 : /* "scipy/linalg/_decomp_update.pyx":1572
31060 : * raise ValueError("'k' is out of bounds")
31061 : * if k1 < 0:
31062 : * k1 += m # <<<<<<<<<<<<<<
31063 : * if k1 + p1 > m or p1 <= 0:
31064 : * raise ValueError("'p' is out of range")
31065 : */
31066 16 : __pyx_v_k1 = (__pyx_v_k1 + __pyx_v_m);
31067 :
31068 : /* "scipy/linalg/_decomp_update.pyx":1571
31069 : * if not (-m <= k1 < m):
31070 : * raise ValueError("'k' is out of bounds")
31071 : * if k1 < 0: # <<<<<<<<<<<<<<
31072 : * k1 += m
31073 : * if k1 + p1 > m or p1 <= 0:
31074 : */
31075 : }
31076 :
31077 : /* "scipy/linalg/_decomp_update.pyx":1573
31078 : * if k1 < 0:
31079 : * k1 += m
31080 : * if k1 + p1 > m or p1 <= 0: # <<<<<<<<<<<<<<
31081 : * raise ValueError("'p' is out of range")
31082 : * if economic:
31083 : */
31084 1332 : __pyx_t_2 = ((__pyx_v_k1 + __pyx_v_p1) > __pyx_v_m);
31085 1332 : if (!__pyx_t_2) {
31086 1328 : } else {
31087 4 : __pyx_t_12 = __pyx_t_2;
31088 4 : goto __pyx_L7_bool_binop_done;
31089 : }
31090 1328 : __pyx_t_2 = (__pyx_v_p1 <= 0);
31091 1328 : __pyx_t_12 = __pyx_t_2;
31092 1332 : __pyx_L7_bool_binop_done:;
31093 1332 : if (unlikely(__pyx_t_12)) {
31094 :
31095 : /* "scipy/linalg/_decomp_update.pyx":1574
31096 : * k1 += m
31097 : * if k1 + p1 > m or p1 <= 0:
31098 : * raise ValueError("'p' is out of range") # <<<<<<<<<<<<<<
31099 : * if economic:
31100 : * # handle the special case of (M,1), (1,1)
31101 : */
31102 12 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1574, __pyx_L1_error)
31103 12 : __Pyx_GOTREF(__pyx_t_3);
31104 12 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
31105 12 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
31106 12 : __PYX_ERR(0, 1574, __pyx_L1_error)
31107 :
31108 : /* "scipy/linalg/_decomp_update.pyx":1573
31109 : * if k1 < 0:
31110 : * k1 += m
31111 : * if k1 + p1 > m or p1 <= 0: # <<<<<<<<<<<<<<
31112 : * raise ValueError("'p' is out of range")
31113 : * if economic:
31114 : */
31115 : }
31116 :
31117 : /* "scipy/linalg/_decomp_update.pyx":1575
31118 : * if k1 + p1 > m or p1 <= 0:
31119 : * raise ValueError("'p' is out of range")
31120 : * if economic: # <<<<<<<<<<<<<<
31121 : * # handle the special case of (M,1), (1,1)
31122 : * if n == 1:
31123 : */
31124 1320 : if (__pyx_v_economic) {
31125 :
31126 : /* "scipy/linalg/_decomp_update.pyx":1577
31127 : * if economic:
31128 : * # handle the special case of (M,1), (1,1)
31129 : * if n == 1: # <<<<<<<<<<<<<<
31130 : * qnew = np.delete(q1, slice(k1, k1 + p1), 0)
31131 : * norm = np.linalg.norm(qnew)
31132 : */
31133 192 : __pyx_t_12 = (__pyx_v_n == 1);
31134 192 : if (__pyx_t_12) {
31135 :
31136 : /* "scipy/linalg/_decomp_update.pyx":1578
31137 : * # handle the special case of (M,1), (1,1)
31138 : * if n == 1:
31139 : * qnew = np.delete(q1, slice(k1, k1 + p1), 0) # <<<<<<<<<<<<<<
31140 : * norm = np.linalg.norm(qnew)
31141 : * return qnew / norm, r1 * norm
31142 : */
31143 76 : __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1578, __pyx_L1_error)
31144 76 : __Pyx_GOTREF(__pyx_t_9);
31145 76 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_delete); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1578, __pyx_L1_error)
31146 76 : __Pyx_GOTREF(__pyx_t_8);
31147 76 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31148 76 : __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_k1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1578, __pyx_L1_error)
31149 76 : __Pyx_GOTREF(__pyx_t_9);
31150 76 : __pyx_t_7 = __Pyx_PyInt_From_int((__pyx_v_k1 + __pyx_v_p1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1578, __pyx_L1_error)
31151 76 : __Pyx_GOTREF(__pyx_t_7);
31152 76 : __pyx_t_6 = PySlice_New(__pyx_t_9, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1578, __pyx_L1_error)
31153 76 : __Pyx_GOTREF(__pyx_t_6);
31154 76 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31155 76 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31156 76 : __pyx_t_7 = NULL;
31157 76 : __pyx_t_13 = 0;
31158 : #if CYTHON_UNPACK_METHODS
31159 76 : if (unlikely(PyMethod_Check(__pyx_t_8))) {
31160 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
31161 0 : if (likely(__pyx_t_7)) {
31162 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
31163 0 : __Pyx_INCREF(__pyx_t_7);
31164 0 : __Pyx_INCREF(function);
31165 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
31166 : __pyx_t_13 = 1;
31167 : }
31168 : }
31169 : #endif
31170 : {
31171 76 : PyObject *__pyx_callargs[4] = {__pyx_t_7, ((PyObject *)__pyx_v_q1), __pyx_t_6, __pyx_int_0};
31172 76 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_13, 3+__pyx_t_13);
31173 76 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
31174 76 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
31175 76 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1578, __pyx_L1_error)
31176 76 : __Pyx_GOTREF(__pyx_t_3);
31177 76 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31178 : }
31179 76 : __pyx_v_qnew = __pyx_t_3;
31180 76 : __pyx_t_3 = 0;
31181 :
31182 : /* "scipy/linalg/_decomp_update.pyx":1579
31183 : * if n == 1:
31184 : * qnew = np.delete(q1, slice(k1, k1 + p1), 0)
31185 : * norm = np.linalg.norm(qnew) # <<<<<<<<<<<<<<
31186 : * return qnew / norm, r1 * norm
31187 : * if not cnp.PyArray_ISONESEGMENT(q1):
31188 : */
31189 76 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1579, __pyx_L1_error)
31190 76 : __Pyx_GOTREF(__pyx_t_8);
31191 76 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_linalg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1579, __pyx_L1_error)
31192 76 : __Pyx_GOTREF(__pyx_t_6);
31193 76 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31194 76 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_norm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1579, __pyx_L1_error)
31195 76 : __Pyx_GOTREF(__pyx_t_8);
31196 76 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
31197 76 : __pyx_t_6 = NULL;
31198 76 : __pyx_t_13 = 0;
31199 : #if CYTHON_UNPACK_METHODS
31200 76 : if (likely(PyMethod_Check(__pyx_t_8))) {
31201 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
31202 0 : if (likely(__pyx_t_6)) {
31203 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
31204 0 : __Pyx_INCREF(__pyx_t_6);
31205 0 : __Pyx_INCREF(function);
31206 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
31207 : __pyx_t_13 = 1;
31208 : }
31209 : }
31210 : #endif
31211 : {
31212 76 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_qnew};
31213 76 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
31214 76 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
31215 76 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1579, __pyx_L1_error)
31216 76 : __Pyx_GOTREF(__pyx_t_3);
31217 76 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31218 : }
31219 76 : __pyx_v_norm = __pyx_t_3;
31220 76 : __pyx_t_3 = 0;
31221 :
31222 : /* "scipy/linalg/_decomp_update.pyx":1580
31223 : * qnew = np.delete(q1, slice(k1, k1 + p1), 0)
31224 : * norm = np.linalg.norm(qnew)
31225 : * return qnew / norm, r1 * norm # <<<<<<<<<<<<<<
31226 : * if not cnp.PyArray_ISONESEGMENT(q1):
31227 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
31228 : */
31229 76 : __Pyx_XDECREF(__pyx_r);
31230 76 : __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_qnew, __pyx_v_norm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1580, __pyx_L1_error)
31231 76 : __Pyx_GOTREF(__pyx_t_3);
31232 76 : __pyx_t_8 = PyNumber_Multiply(((PyObject *)__pyx_v_r1), __pyx_v_norm); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1580, __pyx_L1_error)
31233 76 : __Pyx_GOTREF(__pyx_t_8);
31234 76 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1580, __pyx_L1_error)
31235 76 : __Pyx_GOTREF(__pyx_t_6);
31236 76 : __Pyx_GIVEREF(__pyx_t_3);
31237 76 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 1580, __pyx_L1_error);
31238 76 : __Pyx_GIVEREF(__pyx_t_8);
31239 76 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8)) __PYX_ERR(0, 1580, __pyx_L1_error);
31240 76 : __pyx_t_3 = 0;
31241 76 : __pyx_t_8 = 0;
31242 76 : __pyx_r = __pyx_t_6;
31243 76 : __pyx_t_6 = 0;
31244 76 : goto __pyx_L0;
31245 :
31246 : /* "scipy/linalg/_decomp_update.pyx":1577
31247 : * if economic:
31248 : * # handle the special case of (M,1), (1,1)
31249 : * if n == 1: # <<<<<<<<<<<<<<
31250 : * qnew = np.delete(q1, slice(k1, k1 + p1), 0)
31251 : * norm = np.linalg.norm(qnew)
31252 : */
31253 : }
31254 :
31255 : /* "scipy/linalg/_decomp_update.pyx":1581
31256 : * norm = np.linalg.norm(qnew)
31257 : * return qnew / norm, r1 * norm
31258 : * if not cnp.PyArray_ISONESEGMENT(q1): # <<<<<<<<<<<<<<
31259 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
31260 : * qisF = True
31261 : */
31262 116 : __pyx_t_12 = (!PyArray_ISONESEGMENT(__pyx_v_q1));
31263 116 : if (__pyx_t_12) {
31264 :
31265 : /* "scipy/linalg/_decomp_update.pyx":1582
31266 : * return qnew / norm, r1 * norm
31267 : * if not cnp.PyArray_ISONESEGMENT(q1):
31268 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
31269 : * qisF = True
31270 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
31271 : */
31272 0 : __pyx_t_6 = ((PyObject *)PyArray_FromArray(__pyx_v_q1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1582, __pyx_L1_error)
31273 0 : __Pyx_GOTREF(__pyx_t_6);
31274 0 : __Pyx_DECREF_SET(__pyx_v_q1, ((PyArrayObject *)__pyx_t_6));
31275 0 : __pyx_t_6 = 0;
31276 :
31277 : /* "scipy/linalg/_decomp_update.pyx":1583
31278 : * if not cnp.PyArray_ISONESEGMENT(q1):
31279 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
31280 : * qisF = True # <<<<<<<<<<<<<<
31281 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
31282 : * qisF = True
31283 : */
31284 0 : __pyx_v_qisF = 1;
31285 :
31286 : /* "scipy/linalg/_decomp_update.pyx":1581
31287 : * norm = np.linalg.norm(qnew)
31288 : * return qnew / norm, r1 * norm
31289 : * if not cnp.PyArray_ISONESEGMENT(q1): # <<<<<<<<<<<<<<
31290 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
31291 : * qisF = True
31292 : */
31293 0 : goto __pyx_L11;
31294 : }
31295 :
31296 : /* "scipy/linalg/_decomp_update.pyx":1584
31297 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
31298 : * qisF = True
31299 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
31300 : * qisF = True
31301 : * else:
31302 : */
31303 116 : __pyx_t_12 = PyArray_CHKFLAGS(__pyx_v_q1, NPY_ARRAY_F_CONTIGUOUS);
31304 116 : if (__pyx_t_12) {
31305 :
31306 : /* "scipy/linalg/_decomp_update.pyx":1585
31307 : * qisF = True
31308 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
31309 : * qisF = True # <<<<<<<<<<<<<<
31310 : * else:
31311 : * qisF = False
31312 : */
31313 116 : __pyx_v_qisF = 1;
31314 :
31315 : /* "scipy/linalg/_decomp_update.pyx":1584
31316 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
31317 : * qisF = True
31318 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
31319 : * qisF = True
31320 : * else:
31321 : */
31322 116 : goto __pyx_L11;
31323 : }
31324 :
31325 : /* "scipy/linalg/_decomp_update.pyx":1587
31326 : * qisF = True
31327 : * else:
31328 : * qisF = False # <<<<<<<<<<<<<<
31329 : * if m-p >= n:
31330 : * p_eco = p1
31331 : */
31332 : /*else*/ {
31333 : __pyx_v_qisF = 0;
31334 : }
31335 116 : __pyx_L11:;
31336 :
31337 : /* "scipy/linalg/_decomp_update.pyx":1588
31338 : * else:
31339 : * qisF = False
31340 : * if m-p >= n: # <<<<<<<<<<<<<<
31341 : * p_eco = p1
31342 : * p_full = 0
31343 : */
31344 116 : __pyx_t_12 = ((__pyx_v_m - __pyx_v_p) >= __pyx_v_n);
31345 116 : if (__pyx_t_12) {
31346 :
31347 : /* "scipy/linalg/_decomp_update.pyx":1589
31348 : * qisF = False
31349 : * if m-p >= n:
31350 : * p_eco = p1 # <<<<<<<<<<<<<<
31351 : * p_full = 0
31352 : * else:
31353 : */
31354 92 : __pyx_v_p_eco = __pyx_v_p1;
31355 :
31356 : /* "scipy/linalg/_decomp_update.pyx":1590
31357 : * if m-p >= n:
31358 : * p_eco = p1
31359 : * p_full = 0 # <<<<<<<<<<<<<<
31360 : * else:
31361 : * p_eco = m-n
31362 : */
31363 92 : __pyx_v_p_full = 0;
31364 :
31365 : /* "scipy/linalg/_decomp_update.pyx":1588
31366 : * else:
31367 : * qisF = False
31368 : * if m-p >= n: # <<<<<<<<<<<<<<
31369 : * p_eco = p1
31370 : * p_full = 0
31371 : */
31372 92 : goto __pyx_L12;
31373 : }
31374 :
31375 : /* "scipy/linalg/_decomp_update.pyx":1592
31376 : * p_full = 0
31377 : * else:
31378 : * p_eco = m-n # <<<<<<<<<<<<<<
31379 : * p_full = p1 - p_eco
31380 : * qptr = extract(q1, qs)
31381 : */
31382 : /*else*/ {
31383 24 : __pyx_v_p_eco = (__pyx_v_m - __pyx_v_n);
31384 :
31385 : /* "scipy/linalg/_decomp_update.pyx":1593
31386 : * else:
31387 : * p_eco = m-n
31388 : * p_full = p1 - p_eco # <<<<<<<<<<<<<<
31389 : * qptr = extract(q1, qs)
31390 : * rptr = extract(r1, rs)
31391 : */
31392 24 : __pyx_v_p_full = (__pyx_v_p1 - __pyx_v_p_eco);
31393 : }
31394 116 : __pyx_L12:;
31395 :
31396 : /* "scipy/linalg/_decomp_update.pyx":1594
31397 : * p_eco = m-n
31398 : * p_full = p1 - p_eco
31399 : * qptr = extract(q1, qs) # <<<<<<<<<<<<<<
31400 : * rptr = extract(r1, rs)
31401 : * with nogil:
31402 : */
31403 116 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q1, __pyx_v_qs);
31404 :
31405 : /* "scipy/linalg/_decomp_update.pyx":1595
31406 : * p_full = p1 - p_eco
31407 : * qptr = extract(q1, qs)
31408 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
31409 : * with nogil:
31410 : * if typecode == cnp.NPY_FLOAT:
31411 : */
31412 116 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
31413 :
31414 : /* "scipy/linalg/_decomp_update.pyx":1596
31415 : * qptr = extract(q1, qs)
31416 : * rptr = extract(r1, rs)
31417 : * with nogil: # <<<<<<<<<<<<<<
31418 : * if typecode == cnp.NPY_FLOAT:
31419 : * info = thin_qr_row_delete(m, n, <float*>qptr, qs, qisF,
31420 : */
31421 : {
31422 : #ifdef WITH_THREAD
31423 116 : PyThreadState *_save;
31424 116 : _save = NULL;
31425 116 : Py_UNBLOCK_THREADS
31426 116 : __Pyx_FastGIL_Remember();
31427 : #endif
31428 : /*try:*/ {
31429 :
31430 : /* "scipy/linalg/_decomp_update.pyx":1597
31431 : * rptr = extract(r1, rs)
31432 : * with nogil:
31433 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
31434 : * info = thin_qr_row_delete(m, n, <float*>qptr, qs, qisF,
31435 : * <float*>rptr, rs, k1, p_eco, p_full)
31436 : */
31437 116 : switch (__pyx_v_typecode) {
31438 29 : case NPY_FLOAT:
31439 :
31440 : /* "scipy/linalg/_decomp_update.pyx":1598
31441 : * with nogil:
31442 : * if typecode == cnp.NPY_FLOAT:
31443 : * info = thin_qr_row_delete(m, n, <float*>qptr, qs, qisF, # <<<<<<<<<<<<<<
31444 : * <float*>rptr, rs, k1, p_eco, p_full)
31445 : * elif typecode == cnp.NPY_DOUBLE:
31446 : */
31447 29 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(__pyx_v_m, __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p_eco, __pyx_v_p_full);
31448 :
31449 : /* "scipy/linalg/_decomp_update.pyx":1597
31450 : * rptr = extract(r1, rs)
31451 : * with nogil:
31452 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
31453 : * info = thin_qr_row_delete(m, n, <float*>qptr, qs, qisF,
31454 : * <float*>rptr, rs, k1, p_eco, p_full)
31455 : */
31456 29 : break;
31457 29 : case NPY_DOUBLE:
31458 :
31459 : /* "scipy/linalg/_decomp_update.pyx":1601
31460 : * <float*>rptr, rs, k1, p_eco, p_full)
31461 : * elif typecode == cnp.NPY_DOUBLE:
31462 : * info = thin_qr_row_delete(m, n, <double*>qptr, qs, qisF, # <<<<<<<<<<<<<<
31463 : * <double*>rptr, rs, k1, p_eco, p_full)
31464 : * elif typecode == cnp.NPY_CFLOAT:
31465 : */
31466 29 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(__pyx_v_m, __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p_eco, __pyx_v_p_full);
31467 :
31468 : /* "scipy/linalg/_decomp_update.pyx":1600
31469 : * info = thin_qr_row_delete(m, n, <float*>qptr, qs, qisF,
31470 : * <float*>rptr, rs, k1, p_eco, p_full)
31471 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
31472 : * info = thin_qr_row_delete(m, n, <double*>qptr, qs, qisF,
31473 : * <double*>rptr, rs, k1, p_eco, p_full)
31474 : */
31475 29 : break;
31476 29 : case NPY_CFLOAT:
31477 :
31478 : /* "scipy/linalg/_decomp_update.pyx":1604
31479 : * <double*>rptr, rs, k1, p_eco, p_full)
31480 : * elif typecode == cnp.NPY_CFLOAT:
31481 : * info = thin_qr_row_delete(m, n, <float_complex*>qptr, qs, qisF, # <<<<<<<<<<<<<<
31482 : * <float_complex*>rptr, rs, k1, p_eco, p_full)
31483 : * else: # typecode == cnp.NPY_CDOUBLE:
31484 : */
31485 29 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(__pyx_v_m, __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p_eco, __pyx_v_p_full);
31486 :
31487 : /* "scipy/linalg/_decomp_update.pyx":1603
31488 : * info = thin_qr_row_delete(m, n, <double*>qptr, qs, qisF,
31489 : * <double*>rptr, rs, k1, p_eco, p_full)
31490 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
31491 : * info = thin_qr_row_delete(m, n, <float_complex*>qptr, qs, qisF,
31492 : * <float_complex*>rptr, rs, k1, p_eco, p_full)
31493 : */
31494 29 : break;
31495 29 : default:
31496 :
31497 : /* "scipy/linalg/_decomp_update.pyx":1607
31498 : * <float_complex*>rptr, rs, k1, p_eco, p_full)
31499 : * else: # typecode == cnp.NPY_CDOUBLE:
31500 : * info = thin_qr_row_delete(m, n, <double_complex*>qptr, qs, qisF, # <<<<<<<<<<<<<<
31501 : * <double_complex*>rptr, rs, k1, p_eco, p_full)
31502 : * if info == 1:
31503 : */
31504 29 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_delete(__pyx_v_m, __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p_eco, __pyx_v_p_full);
31505 29 : break;
31506 : }
31507 : }
31508 :
31509 : /* "scipy/linalg/_decomp_update.pyx":1596
31510 : * qptr = extract(q1, qs)
31511 : * rptr = extract(r1, rs)
31512 : * with nogil: # <<<<<<<<<<<<<<
31513 : * if typecode == cnp.NPY_FLOAT:
31514 : * info = thin_qr_row_delete(m, n, <float*>qptr, qs, qisF,
31515 : */
31516 : /*finally:*/ {
31517 : /*normal exit:*/{
31518 : #ifdef WITH_THREAD
31519 116 : __Pyx_FastGIL_Forget();
31520 116 : Py_BLOCK_THREADS
31521 : #endif
31522 116 : goto __pyx_L15;
31523 : }
31524 116 : __pyx_L15:;
31525 : }
31526 : }
31527 :
31528 : /* "scipy/linalg/_decomp_update.pyx":1609
31529 : * info = thin_qr_row_delete(m, n, <double_complex*>qptr, qs, qisF,
31530 : * <double_complex*>rptr, rs, k1, p_eco, p_full)
31531 : * if info == 1: # <<<<<<<<<<<<<<
31532 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:]
31533 : * elif info == MEMORY_ERROR:
31534 : */
31535 116 : __pyx_t_12 = (__pyx_v_info == 1);
31536 116 : if (likely(__pyx_t_12)) {
31537 :
31538 : /* "scipy/linalg/_decomp_update.pyx":1610
31539 : * <double_complex*>rptr, rs, k1, p_eco, p_full)
31540 : * if info == 1:
31541 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:] # <<<<<<<<<<<<<<
31542 : * elif info == MEMORY_ERROR:
31543 : * raise MemoryError('Unable to allocate memory for array.')
31544 : */
31545 116 : __Pyx_XDECREF(__pyx_r);
31546 116 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_p_full); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1610, __pyx_L1_error)
31547 116 : __Pyx_GOTREF(__pyx_t_6);
31548 116 : __pyx_t_8 = __Pyx_PyInt_From_int((-__pyx_v_p_eco)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1610, __pyx_L1_error)
31549 116 : __Pyx_GOTREF(__pyx_t_8);
31550 116 : __pyx_t_3 = PySlice_New(__pyx_t_6, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error)
31551 116 : __Pyx_GOTREF(__pyx_t_3);
31552 116 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
31553 116 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31554 116 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_p_full); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1610, __pyx_L1_error)
31555 116 : __Pyx_GOTREF(__pyx_t_8);
31556 116 : __pyx_t_6 = PySlice_New(__pyx_t_8, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1610, __pyx_L1_error)
31557 116 : __Pyx_GOTREF(__pyx_t_6);
31558 116 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31559 116 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1610, __pyx_L1_error)
31560 116 : __Pyx_GOTREF(__pyx_t_8);
31561 116 : __Pyx_GIVEREF(__pyx_t_3);
31562 116 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error);
31563 116 : __Pyx_GIVEREF(__pyx_t_6);
31564 116 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 1610, __pyx_L1_error);
31565 116 : __pyx_t_3 = 0;
31566 116 : __pyx_t_6 = 0;
31567 116 : __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_q1), __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1610, __pyx_L1_error)
31568 116 : __Pyx_GOTREF(__pyx_t_6);
31569 116 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31570 116 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_p_full); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1610, __pyx_L1_error)
31571 116 : __Pyx_GOTREF(__pyx_t_8);
31572 116 : __pyx_t_3 = PySlice_New(__pyx_t_8, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error)
31573 116 : __Pyx_GOTREF(__pyx_t_3);
31574 116 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31575 116 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1610, __pyx_L1_error)
31576 116 : __Pyx_GOTREF(__pyx_t_8);
31577 116 : __Pyx_GIVEREF(__pyx_t_3);
31578 116 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error);
31579 116 : __Pyx_INCREF(__pyx_slice__16);
31580 116 : __Pyx_GIVEREF(__pyx_slice__16);
31581 116 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_slice__16)) __PYX_ERR(0, 1610, __pyx_L1_error);
31582 116 : __pyx_t_3 = 0;
31583 116 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error)
31584 116 : __Pyx_GOTREF(__pyx_t_3);
31585 116 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31586 116 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1610, __pyx_L1_error)
31587 116 : __Pyx_GOTREF(__pyx_t_8);
31588 116 : __Pyx_GIVEREF(__pyx_t_6);
31589 116 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1610, __pyx_L1_error);
31590 116 : __Pyx_GIVEREF(__pyx_t_3);
31591 116 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error);
31592 116 : __pyx_t_6 = 0;
31593 116 : __pyx_t_3 = 0;
31594 116 : __pyx_r = __pyx_t_8;
31595 116 : __pyx_t_8 = 0;
31596 116 : goto __pyx_L0;
31597 :
31598 : /* "scipy/linalg/_decomp_update.pyx":1609
31599 : * info = thin_qr_row_delete(m, n, <double_complex*>qptr, qs, qisF,
31600 : * <double_complex*>rptr, rs, k1, p_eco, p_full)
31601 : * if info == 1: # <<<<<<<<<<<<<<
31602 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:]
31603 : * elif info == MEMORY_ERROR:
31604 : */
31605 : }
31606 :
31607 : /* "scipy/linalg/_decomp_update.pyx":1611
31608 : * if info == 1:
31609 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:]
31610 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
31611 : * raise MemoryError('Unable to allocate memory for array.')
31612 : * else:
31613 : */
31614 0 : __pyx_t_12 = (__pyx_v_info == __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR);
31615 0 : if (unlikely(__pyx_t_12)) {
31616 :
31617 : /* "scipy/linalg/_decomp_update.pyx":1612
31618 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:]
31619 : * elif info == MEMORY_ERROR:
31620 : * raise MemoryError('Unable to allocate memory for array.') # <<<<<<<<<<<<<<
31621 : * else:
31622 : * raise ValueError('Reorthogonalization Failed, unable to perform row deletion.')
31623 : */
31624 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1612, __pyx_L1_error)
31625 0 : __Pyx_GOTREF(__pyx_t_8);
31626 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
31627 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31628 0 : __PYX_ERR(0, 1612, __pyx_L1_error)
31629 :
31630 : /* "scipy/linalg/_decomp_update.pyx":1611
31631 : * if info == 1:
31632 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:]
31633 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
31634 : * raise MemoryError('Unable to allocate memory for array.')
31635 : * else:
31636 : */
31637 : }
31638 :
31639 : /* "scipy/linalg/_decomp_update.pyx":1614
31640 : * raise MemoryError('Unable to allocate memory for array.')
31641 : * else:
31642 : * raise ValueError('Reorthogonalization Failed, unable to perform row deletion.') # <<<<<<<<<<<<<<
31643 : * else:
31644 : * qptr = extract(q1, qs)
31645 : */
31646 : /*else*/ {
31647 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1614, __pyx_L1_error)
31648 0 : __Pyx_GOTREF(__pyx_t_8);
31649 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
31650 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31651 0 : __PYX_ERR(0, 1614, __pyx_L1_error)
31652 : }
31653 :
31654 : /* "scipy/linalg/_decomp_update.pyx":1575
31655 : * if k1 + p1 > m or p1 <= 0:
31656 : * raise ValueError("'p' is out of range")
31657 : * if economic: # <<<<<<<<<<<<<<
31658 : * # handle the special case of (M,1), (1,1)
31659 : * if n == 1:
31660 : */
31661 : }
31662 :
31663 : /* "scipy/linalg/_decomp_update.pyx":1616
31664 : * raise ValueError('Reorthogonalization Failed, unable to perform row deletion.')
31665 : * else:
31666 : * qptr = extract(q1, qs) # <<<<<<<<<<<<<<
31667 : * rptr = extract(r1, rs)
31668 : * with nogil:
31669 : */
31670 : /*else*/ {
31671 1128 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q1, __pyx_v_qs);
31672 :
31673 : /* "scipy/linalg/_decomp_update.pyx":1617
31674 : * else:
31675 : * qptr = extract(q1, qs)
31676 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
31677 : * with nogil:
31678 : * if typecode == cnp.NPY_FLOAT:
31679 : */
31680 1128 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
31681 :
31682 : /* "scipy/linalg/_decomp_update.pyx":1618
31683 : * qptr = extract(q1, qs)
31684 : * rptr = extract(r1, rs)
31685 : * with nogil: # <<<<<<<<<<<<<<
31686 : * if typecode == cnp.NPY_FLOAT:
31687 : * qr_block_row_delete(m, n, <float*>qptr, qs,
31688 : */
31689 : {
31690 : #ifdef WITH_THREAD
31691 1128 : PyThreadState *_save;
31692 1128 : _save = NULL;
31693 1128 : Py_UNBLOCK_THREADS
31694 1128 : __Pyx_FastGIL_Remember();
31695 : #endif
31696 : /*try:*/ {
31697 :
31698 : /* "scipy/linalg/_decomp_update.pyx":1619
31699 : * rptr = extract(r1, rs)
31700 : * with nogil:
31701 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
31702 : * qr_block_row_delete(m, n, <float*>qptr, qs,
31703 : * <float*>rptr, rs, k1, p1)
31704 : */
31705 1128 : switch (__pyx_v_typecode) {
31706 282 : case NPY_FLOAT:
31707 :
31708 : /* "scipy/linalg/_decomp_update.pyx":1620
31709 : * with nogil:
31710 : * if typecode == cnp.NPY_FLOAT:
31711 : * qr_block_row_delete(m, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
31712 : * <float*>rptr, rs, k1, p1)
31713 : * elif typecode == cnp.NPY_DOUBLE:
31714 : */
31715 282 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
31716 :
31717 : /* "scipy/linalg/_decomp_update.pyx":1619
31718 : * rptr = extract(r1, rs)
31719 : * with nogil:
31720 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
31721 : * qr_block_row_delete(m, n, <float*>qptr, qs,
31722 : * <float*>rptr, rs, k1, p1)
31723 : */
31724 282 : break;
31725 282 : case NPY_DOUBLE:
31726 :
31727 : /* "scipy/linalg/_decomp_update.pyx":1623
31728 : * <float*>rptr, rs, k1, p1)
31729 : * elif typecode == cnp.NPY_DOUBLE:
31730 : * qr_block_row_delete(m, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
31731 : * <double*>rptr, rs, k1, p1)
31732 : * elif typecode == cnp.NPY_CFLOAT:
31733 : */
31734 282 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
31735 :
31736 : /* "scipy/linalg/_decomp_update.pyx":1622
31737 : * qr_block_row_delete(m, n, <float*>qptr, qs,
31738 : * <float*>rptr, rs, k1, p1)
31739 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
31740 : * qr_block_row_delete(m, n, <double*>qptr, qs,
31741 : * <double*>rptr, rs, k1, p1)
31742 : */
31743 282 : break;
31744 282 : case NPY_CFLOAT:
31745 :
31746 : /* "scipy/linalg/_decomp_update.pyx":1626
31747 : * <double*>rptr, rs, k1, p1)
31748 : * elif typecode == cnp.NPY_CFLOAT:
31749 : * qr_block_row_delete(m, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
31750 : * <float_complex*>rptr, rs, k1, p1)
31751 : * else: # typecode == cnp.NPY_CDOUBLE:
31752 : */
31753 282 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
31754 :
31755 : /* "scipy/linalg/_decomp_update.pyx":1625
31756 : * qr_block_row_delete(m, n, <double*>qptr, qs,
31757 : * <double*>rptr, rs, k1, p1)
31758 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
31759 : * qr_block_row_delete(m, n, <float_complex*>qptr, qs,
31760 : * <float_complex*>rptr, rs, k1, p1)
31761 : */
31762 282 : break;
31763 282 : default:
31764 :
31765 : /* "scipy/linalg/_decomp_update.pyx":1629
31766 : * <float_complex*>rptr, rs, k1, p1)
31767 : * else: # typecode == cnp.NPY_CDOUBLE:
31768 : * qr_block_row_delete(m, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
31769 : * <double_complex*>rptr, rs, k1, p1)
31770 : * return q1[p1:, p1:], r1[p1:, :]
31771 : */
31772 282 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_delete(__pyx_v_m, __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
31773 282 : break;
31774 : }
31775 : }
31776 :
31777 : /* "scipy/linalg/_decomp_update.pyx":1618
31778 : * qptr = extract(q1, qs)
31779 : * rptr = extract(r1, rs)
31780 : * with nogil: # <<<<<<<<<<<<<<
31781 : * if typecode == cnp.NPY_FLOAT:
31782 : * qr_block_row_delete(m, n, <float*>qptr, qs,
31783 : */
31784 : /*finally:*/ {
31785 : /*normal exit:*/{
31786 : #ifdef WITH_THREAD
31787 1128 : __Pyx_FastGIL_Forget();
31788 1128 : Py_BLOCK_THREADS
31789 : #endif
31790 1128 : goto __pyx_L19;
31791 : }
31792 1128 : __pyx_L19:;
31793 : }
31794 : }
31795 :
31796 : /* "scipy/linalg/_decomp_update.pyx":1631
31797 : * qr_block_row_delete(m, n, <double_complex*>qptr, qs,
31798 : * <double_complex*>rptr, rs, k1, p1)
31799 : * return q1[p1:, p1:], r1[p1:, :] # <<<<<<<<<<<<<<
31800 : * elif which == 'col':
31801 : * # Special case single column removal to be more accepting of C ordered
31802 : */
31803 1128 : __Pyx_XDECREF(__pyx_r);
31804 1128 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1631, __pyx_L1_error)
31805 1128 : __Pyx_GOTREF(__pyx_t_8);
31806 1128 : __pyx_t_3 = PySlice_New(__pyx_t_8, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error)
31807 1128 : __Pyx_GOTREF(__pyx_t_3);
31808 1128 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31809 1128 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1631, __pyx_L1_error)
31810 1128 : __Pyx_GOTREF(__pyx_t_8);
31811 1128 : __pyx_t_6 = PySlice_New(__pyx_t_8, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1631, __pyx_L1_error)
31812 1128 : __Pyx_GOTREF(__pyx_t_6);
31813 1128 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31814 1128 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1631, __pyx_L1_error)
31815 1128 : __Pyx_GOTREF(__pyx_t_8);
31816 1128 : __Pyx_GIVEREF(__pyx_t_3);
31817 1128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error);
31818 1128 : __Pyx_GIVEREF(__pyx_t_6);
31819 1128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 1631, __pyx_L1_error);
31820 1128 : __pyx_t_3 = 0;
31821 1128 : __pyx_t_6 = 0;
31822 1128 : __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_q1), __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1631, __pyx_L1_error)
31823 1128 : __Pyx_GOTREF(__pyx_t_6);
31824 1128 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31825 1128 : __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1631, __pyx_L1_error)
31826 1128 : __Pyx_GOTREF(__pyx_t_8);
31827 1128 : __pyx_t_3 = PySlice_New(__pyx_t_8, Py_None, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error)
31828 1128 : __Pyx_GOTREF(__pyx_t_3);
31829 1128 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31830 1128 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1631, __pyx_L1_error)
31831 1128 : __Pyx_GOTREF(__pyx_t_8);
31832 1128 : __Pyx_GIVEREF(__pyx_t_3);
31833 1128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error);
31834 1128 : __Pyx_INCREF(__pyx_slice__16);
31835 1128 : __Pyx_GIVEREF(__pyx_slice__16);
31836 1128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_slice__16)) __PYX_ERR(0, 1631, __pyx_L1_error);
31837 1128 : __pyx_t_3 = 0;
31838 1128 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error)
31839 1128 : __Pyx_GOTREF(__pyx_t_3);
31840 1128 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31841 1128 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1631, __pyx_L1_error)
31842 1128 : __Pyx_GOTREF(__pyx_t_8);
31843 1128 : __Pyx_GIVEREF(__pyx_t_6);
31844 1128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1631, __pyx_L1_error);
31845 1128 : __Pyx_GIVEREF(__pyx_t_3);
31846 1128 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error);
31847 1128 : __pyx_t_6 = 0;
31848 1128 : __pyx_t_3 = 0;
31849 1128 : __pyx_r = __pyx_t_8;
31850 1128 : __pyx_t_8 = 0;
31851 1128 : goto __pyx_L0;
31852 : }
31853 :
31854 : /* "scipy/linalg/_decomp_update.pyx":1566
31855 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qr
31856 : *
31857 : * if which == 'row': # <<<<<<<<<<<<<<
31858 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
31859 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
31860 : */
31861 : }
31862 :
31863 : /* "scipy/linalg/_decomp_update.pyx":1632
31864 : * <double_complex*>rptr, rs, k1, p1)
31865 : * return q1[p1:, p1:], r1[p1:, :]
31866 : * elif which == 'col': # <<<<<<<<<<<<<<
31867 : * # Special case single column removal to be more accepting of C ordered
31868 : * # inputs and to avoid allocating a work array for that case.
31869 : */
31870 1432 : __pyx_t_12 = (__Pyx_PyUnicode_Equals(__pyx_v_which, __pyx_n_u_col, Py_EQ)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1632, __pyx_L1_error)
31871 1432 : if (likely(__pyx_t_12)) {
31872 :
31873 : /* "scipy/linalg/_decomp_update.pyx":1635
31874 : * # Special case single column removal to be more accepting of C ordered
31875 : * # inputs and to avoid allocating a work array for that case.
31876 : * if p1 > 1: # <<<<<<<<<<<<<<
31877 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
31878 : * cnp.NPY_ARRAY_F_CONTIGUOUS, overwrite, cnp.NPY_ARRAY_F_CONTIGUOUS,
31879 : */
31880 1428 : __pyx_t_12 = (__pyx_v_p1 > 1);
31881 1428 : if (__pyx_t_12) {
31882 :
31883 : /* "scipy/linalg/_decomp_update.pyx":1636
31884 : * # inputs and to avoid allocating a work array for that case.
31885 : * if p1 > 1:
31886 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite, # <<<<<<<<<<<<<<
31887 : * cnp.NPY_ARRAY_F_CONTIGUOUS, overwrite, cnp.NPY_ARRAY_F_CONTIGUOUS,
31888 : * chkfinite)
31889 : */
31890 812 : __pyx_t_8 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(__pyx_v_Q, __pyx_v_R, __pyx_v_overwrite, NPY_ARRAY_F_CONTIGUOUS, __pyx_v_overwrite, NPY_ARRAY_F_CONTIGUOUS, __pyx_v_chkfinite); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1636, __pyx_L1_error)
31891 708 : __Pyx_GOTREF(__pyx_t_8);
31892 708 : if (likely(__pyx_t_8 != Py_None)) {
31893 708 : PyObject* sequence = __pyx_t_8;
31894 708 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
31895 708 : if (unlikely(size != 6)) {
31896 0 : if (size > 6) __Pyx_RaiseTooManyValuesError(6);
31897 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
31898 0 : __PYX_ERR(0, 1636, __pyx_L1_error)
31899 : }
31900 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31901 708 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
31902 708 : __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
31903 708 : __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
31904 708 : __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3);
31905 708 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4);
31906 708 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 5);
31907 708 : __Pyx_INCREF(__pyx_t_3);
31908 708 : __Pyx_INCREF(__pyx_t_6);
31909 708 : __Pyx_INCREF(__pyx_t_7);
31910 708 : __Pyx_INCREF(__pyx_t_9);
31911 708 : __Pyx_INCREF(__pyx_t_5);
31912 708 : __Pyx_INCREF(__pyx_t_4);
31913 : #else
31914 : {
31915 : Py_ssize_t i;
31916 : PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_7,&__pyx_t_9,&__pyx_t_5,&__pyx_t_4};
31917 : for (i=0; i < 6; i++) {
31918 : PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1636, __pyx_L1_error)
31919 : __Pyx_GOTREF(item);
31920 : *(temps[i]) = item;
31921 : }
31922 : }
31923 : #endif
31924 708 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31925 : } else {
31926 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1636, __pyx_L1_error)
31927 : }
31928 708 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1636, __pyx_L1_error)
31929 708 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1636, __pyx_L1_error)
31930 708 : __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L1_error)
31931 708 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31932 708 : __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L1_error)
31933 708 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31934 708 : __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L1_error)
31935 708 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31936 708 : __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L1_error)
31937 708 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31938 708 : __pyx_v_q1 = ((PyArrayObject *)__pyx_t_3);
31939 708 : __pyx_t_3 = 0;
31940 708 : __pyx_v_r1 = ((PyArrayObject *)__pyx_t_6);
31941 708 : __pyx_t_6 = 0;
31942 708 : __pyx_v_typecode = __pyx_t_11;
31943 708 : __pyx_v_m = __pyx_t_10;
31944 708 : __pyx_v_n = __pyx_t_1;
31945 708 : __pyx_v_economic = __pyx_t_12;
31946 :
31947 : /* "scipy/linalg/_decomp_update.pyx":1635
31948 : * # Special case single column removal to be more accepting of C ordered
31949 : * # inputs and to avoid allocating a work array for that case.
31950 : * if p1 > 1: # <<<<<<<<<<<<<<
31951 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
31952 : * cnp.NPY_ARRAY_F_CONTIGUOUS, overwrite, cnp.NPY_ARRAY_F_CONTIGUOUS,
31953 : */
31954 708 : goto __pyx_L20;
31955 : }
31956 :
31957 : /* "scipy/linalg/_decomp_update.pyx":1640
31958 : * chkfinite)
31959 : * else:
31960 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite, # <<<<<<<<<<<<<<
31961 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
31962 : * o = n if economic else m
31963 : */
31964 : /*else*/ {
31965 :
31966 : /* "scipy/linalg/_decomp_update.pyx":1641
31967 : * else:
31968 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
31969 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite) # <<<<<<<<<<<<<<
31970 : * o = n if economic else m
31971 : * if not (-n <= k1 < n):
31972 : */
31973 616 : __pyx_t_8 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(__pyx_v_Q, __pyx_v_R, __pyx_v_overwrite, 0, __pyx_v_overwrite, 0, __pyx_v_chkfinite); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1640, __pyx_L1_error)
31974 504 : __Pyx_GOTREF(__pyx_t_8);
31975 504 : if (likely(__pyx_t_8 != Py_None)) {
31976 504 : PyObject* sequence = __pyx_t_8;
31977 504 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
31978 504 : if (unlikely(size != 6)) {
31979 0 : if (size > 6) __Pyx_RaiseTooManyValuesError(6);
31980 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
31981 0 : __PYX_ERR(0, 1640, __pyx_L1_error)
31982 : }
31983 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
31984 504 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
31985 504 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
31986 504 : __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
31987 504 : __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
31988 504 : __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
31989 504 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 5);
31990 504 : __Pyx_INCREF(__pyx_t_4);
31991 504 : __Pyx_INCREF(__pyx_t_5);
31992 504 : __Pyx_INCREF(__pyx_t_9);
31993 504 : __Pyx_INCREF(__pyx_t_7);
31994 504 : __Pyx_INCREF(__pyx_t_6);
31995 504 : __Pyx_INCREF(__pyx_t_3);
31996 : #else
31997 : {
31998 : Py_ssize_t i;
31999 : PyObject** temps[6] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_9,&__pyx_t_7,&__pyx_t_6,&__pyx_t_3};
32000 : for (i=0; i < 6; i++) {
32001 : PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1640, __pyx_L1_error)
32002 : __Pyx_GOTREF(item);
32003 : *(temps[i]) = item;
32004 : }
32005 : }
32006 : #endif
32007 504 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32008 : } else {
32009 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1640, __pyx_L1_error)
32010 : }
32011 :
32012 : /* "scipy/linalg/_decomp_update.pyx":1640
32013 : * chkfinite)
32014 : * else:
32015 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite, # <<<<<<<<<<<<<<
32016 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
32017 : * o = n if economic else m
32018 : */
32019 504 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1640, __pyx_L1_error)
32020 504 : if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1640, __pyx_L1_error)
32021 504 : __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L1_error)
32022 504 : __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
32023 504 : __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L1_error)
32024 504 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32025 504 : __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L1_error)
32026 504 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32027 504 : __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1640, __pyx_L1_error)
32028 504 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32029 : __pyx_v_q1 = ((PyArrayObject *)__pyx_t_4);
32030 : __pyx_t_4 = 0;
32031 : __pyx_v_r1 = ((PyArrayObject *)__pyx_t_5);
32032 : __pyx_t_5 = 0;
32033 : __pyx_v_typecode = __pyx_t_1;
32034 : __pyx_v_m = __pyx_t_10;
32035 : __pyx_v_n = __pyx_t_11;
32036 : __pyx_v_economic = __pyx_t_12;
32037 : }
32038 1212 : __pyx_L20:;
32039 :
32040 : /* "scipy/linalg/_decomp_update.pyx":1642
32041 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite,
32042 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
32043 : * o = n if economic else m # <<<<<<<<<<<<<<
32044 : * if not (-n <= k1 < n):
32045 : * raise ValueError("'k' is out of bounds")
32046 : */
32047 1212 : if (__pyx_v_economic) {
32048 : __pyx_t_11 = __pyx_v_n;
32049 : } else {
32050 1120 : __pyx_t_11 = __pyx_v_m;
32051 : }
32052 1212 : __pyx_v_o = __pyx_t_11;
32053 :
32054 : /* "scipy/linalg/_decomp_update.pyx":1643
32055 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
32056 : * o = n if economic else m
32057 : * if not (-n <= k1 < n): # <<<<<<<<<<<<<<
32058 : * raise ValueError("'k' is out of bounds")
32059 : * if k1 < 0:
32060 : */
32061 1212 : __pyx_t_12 = ((-__pyx_v_n) <= __pyx_v_k1);
32062 1212 : if (__pyx_t_12) {
32063 1208 : __pyx_t_12 = (__pyx_v_k1 < __pyx_v_n);
32064 : }
32065 1212 : __pyx_t_2 = (!__pyx_t_12);
32066 1212 : if (unlikely(__pyx_t_2)) {
32067 :
32068 : /* "scipy/linalg/_decomp_update.pyx":1644
32069 : * o = n if economic else m
32070 : * if not (-n <= k1 < n):
32071 : * raise ValueError("'k' is out of bounds") # <<<<<<<<<<<<<<
32072 : * if k1 < 0:
32073 : * k1 += n
32074 : */
32075 8 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1644, __pyx_L1_error)
32076 8 : __Pyx_GOTREF(__pyx_t_8);
32077 8 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
32078 8 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32079 8 : __PYX_ERR(0, 1644, __pyx_L1_error)
32080 :
32081 : /* "scipy/linalg/_decomp_update.pyx":1643
32082 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
32083 : * o = n if economic else m
32084 : * if not (-n <= k1 < n): # <<<<<<<<<<<<<<
32085 : * raise ValueError("'k' is out of bounds")
32086 : * if k1 < 0:
32087 : */
32088 : }
32089 :
32090 : /* "scipy/linalg/_decomp_update.pyx":1645
32091 : * if not (-n <= k1 < n):
32092 : * raise ValueError("'k' is out of bounds")
32093 : * if k1 < 0: # <<<<<<<<<<<<<<
32094 : * k1 += n
32095 : * if k1 + p1 > n or p1 <= 0:
32096 : */
32097 1204 : __pyx_t_2 = (__pyx_v_k1 < 0);
32098 1204 : if (__pyx_t_2) {
32099 :
32100 : /* "scipy/linalg/_decomp_update.pyx":1646
32101 : * raise ValueError("'k' is out of bounds")
32102 : * if k1 < 0:
32103 : * k1 += n # <<<<<<<<<<<<<<
32104 : * if k1 + p1 > n or p1 <= 0:
32105 : * raise ValueError("'p' is out of range")
32106 : */
32107 16 : __pyx_v_k1 = (__pyx_v_k1 + __pyx_v_n);
32108 :
32109 : /* "scipy/linalg/_decomp_update.pyx":1645
32110 : * if not (-n <= k1 < n):
32111 : * raise ValueError("'k' is out of bounds")
32112 : * if k1 < 0: # <<<<<<<<<<<<<<
32113 : * k1 += n
32114 : * if k1 + p1 > n or p1 <= 0:
32115 : */
32116 : }
32117 :
32118 : /* "scipy/linalg/_decomp_update.pyx":1647
32119 : * if k1 < 0:
32120 : * k1 += n
32121 : * if k1 + p1 > n or p1 <= 0: # <<<<<<<<<<<<<<
32122 : * raise ValueError("'p' is out of range")
32123 : *
32124 : */
32125 1204 : __pyx_t_12 = ((__pyx_v_k1 + __pyx_v_p1) > __pyx_v_n);
32126 1204 : if (!__pyx_t_12) {
32127 1200 : } else {
32128 4 : __pyx_t_2 = __pyx_t_12;
32129 4 : goto __pyx_L24_bool_binop_done;
32130 : }
32131 1200 : __pyx_t_12 = (__pyx_v_p1 <= 0);
32132 1200 : __pyx_t_2 = __pyx_t_12;
32133 1204 : __pyx_L24_bool_binop_done:;
32134 1204 : if (unlikely(__pyx_t_2)) {
32135 :
32136 : /* "scipy/linalg/_decomp_update.pyx":1648
32137 : * k1 += n
32138 : * if k1 + p1 > n or p1 <= 0:
32139 : * raise ValueError("'p' is out of range") # <<<<<<<<<<<<<<
32140 : *
32141 : * qptr = extract(q1, qs)
32142 : */
32143 12 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1648, __pyx_L1_error)
32144 12 : __Pyx_GOTREF(__pyx_t_8);
32145 12 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
32146 12 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32147 12 : __PYX_ERR(0, 1648, __pyx_L1_error)
32148 :
32149 : /* "scipy/linalg/_decomp_update.pyx":1647
32150 : * if k1 < 0:
32151 : * k1 += n
32152 : * if k1 + p1 > n or p1 <= 0: # <<<<<<<<<<<<<<
32153 : * raise ValueError("'p' is out of range")
32154 : *
32155 : */
32156 : }
32157 :
32158 : /* "scipy/linalg/_decomp_update.pyx":1650
32159 : * raise ValueError("'p' is out of range")
32160 : *
32161 : * qptr = extract(q1, qs) # <<<<<<<<<<<<<<
32162 : * rptr = extract(r1, rs)
32163 : * if p1 == 1:
32164 : */
32165 1192 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q1, __pyx_v_qs);
32166 :
32167 : /* "scipy/linalg/_decomp_update.pyx":1651
32168 : *
32169 : * qptr = extract(q1, qs)
32170 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
32171 : * if p1 == 1:
32172 : * with nogil:
32173 : */
32174 1192 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
32175 :
32176 : /* "scipy/linalg/_decomp_update.pyx":1652
32177 : * qptr = extract(q1, qs)
32178 : * rptr = extract(r1, rs)
32179 : * if p1 == 1: # <<<<<<<<<<<<<<
32180 : * with nogil:
32181 : * if typecode == cnp.NPY_FLOAT:
32182 : */
32183 1192 : __pyx_t_2 = (__pyx_v_p1 == 1);
32184 1192 : if (__pyx_t_2) {
32185 :
32186 : /* "scipy/linalg/_decomp_update.pyx":1653
32187 : * rptr = extract(r1, rs)
32188 : * if p1 == 1:
32189 : * with nogil: # <<<<<<<<<<<<<<
32190 : * if typecode == cnp.NPY_FLOAT:
32191 : * qr_col_delete(m, o, n, <float*>qptr, qs,
32192 : */
32193 : {
32194 : #ifdef WITH_THREAD
32195 488 : PyThreadState *_save;
32196 488 : _save = NULL;
32197 488 : Py_UNBLOCK_THREADS
32198 488 : __Pyx_FastGIL_Remember();
32199 : #endif
32200 : /*try:*/ {
32201 :
32202 : /* "scipy/linalg/_decomp_update.pyx":1654
32203 : * if p1 == 1:
32204 : * with nogil:
32205 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
32206 : * qr_col_delete(m, o, n, <float*>qptr, qs,
32207 : * <float*>rptr, rs, k1)
32208 : */
32209 488 : switch (__pyx_v_typecode) {
32210 122 : case NPY_FLOAT:
32211 :
32212 : /* "scipy/linalg/_decomp_update.pyx":1655
32213 : * with nogil:
32214 : * if typecode == cnp.NPY_FLOAT:
32215 : * qr_col_delete(m, o, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
32216 : * <float*>rptr, rs, k1)
32217 : * elif typecode == cnp.NPY_DOUBLE:
32218 : */
32219 122 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1);
32220 :
32221 : /* "scipy/linalg/_decomp_update.pyx":1654
32222 : * if p1 == 1:
32223 : * with nogil:
32224 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
32225 : * qr_col_delete(m, o, n, <float*>qptr, qs,
32226 : * <float*>rptr, rs, k1)
32227 : */
32228 122 : break;
32229 122 : case NPY_DOUBLE:
32230 :
32231 : /* "scipy/linalg/_decomp_update.pyx":1658
32232 : * <float*>rptr, rs, k1)
32233 : * elif typecode == cnp.NPY_DOUBLE:
32234 : * qr_col_delete(m, o, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
32235 : * <double*>rptr, rs, k1)
32236 : * elif typecode == cnp.NPY_CFLOAT:
32237 : */
32238 122 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1);
32239 :
32240 : /* "scipy/linalg/_decomp_update.pyx":1657
32241 : * qr_col_delete(m, o, n, <float*>qptr, qs,
32242 : * <float*>rptr, rs, k1)
32243 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
32244 : * qr_col_delete(m, o, n, <double*>qptr, qs,
32245 : * <double*>rptr, rs, k1)
32246 : */
32247 122 : break;
32248 122 : case NPY_CFLOAT:
32249 :
32250 : /* "scipy/linalg/_decomp_update.pyx":1661
32251 : * <double*>rptr, rs, k1)
32252 : * elif typecode == cnp.NPY_CFLOAT:
32253 : * qr_col_delete(m, o, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
32254 : * <float_complex*>rptr, rs, k1)
32255 : * else: # typecode == cnp.NPY_CDOUBLE:
32256 : */
32257 122 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1);
32258 :
32259 : /* "scipy/linalg/_decomp_update.pyx":1660
32260 : * qr_col_delete(m, o, n, <double*>qptr, qs,
32261 : * <double*>rptr, rs, k1)
32262 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
32263 : * qr_col_delete(m, o, n, <float_complex*>qptr, qs,
32264 : * <float_complex*>rptr, rs, k1)
32265 : */
32266 122 : break;
32267 122 : default:
32268 :
32269 : /* "scipy/linalg/_decomp_update.pyx":1664
32270 : * <float_complex*>rptr, rs, k1)
32271 : * else: # typecode == cnp.NPY_CDOUBLE:
32272 : * qr_col_delete(m, o, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
32273 : * <double_complex*>rptr, rs, k1)
32274 : * else:
32275 : */
32276 122 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1);
32277 122 : break;
32278 : }
32279 : }
32280 :
32281 : /* "scipy/linalg/_decomp_update.pyx":1653
32282 : * rptr = extract(r1, rs)
32283 : * if p1 == 1:
32284 : * with nogil: # <<<<<<<<<<<<<<
32285 : * if typecode == cnp.NPY_FLOAT:
32286 : * qr_col_delete(m, o, n, <float*>qptr, qs,
32287 : */
32288 : /*finally:*/ {
32289 : /*normal exit:*/{
32290 : #ifdef WITH_THREAD
32291 488 : __Pyx_FastGIL_Forget();
32292 488 : Py_BLOCK_THREADS
32293 : #endif
32294 488 : goto __pyx_L29;
32295 : }
32296 488 : __pyx_L29:;
32297 : }
32298 : }
32299 :
32300 : /* "scipy/linalg/_decomp_update.pyx":1652
32301 : * qptr = extract(q1, qs)
32302 : * rptr = extract(r1, rs)
32303 : * if p1 == 1: # <<<<<<<<<<<<<<
32304 : * with nogil:
32305 : * if typecode == cnp.NPY_FLOAT:
32306 : */
32307 488 : goto __pyx_L26;
32308 : }
32309 :
32310 : /* "scipy/linalg/_decomp_update.pyx":1667
32311 : * <double_complex*>rptr, rs, k1)
32312 : * else:
32313 : * with nogil: # <<<<<<<<<<<<<<
32314 : * if typecode == cnp.NPY_FLOAT:
32315 : * info = qr_block_col_delete(m, o, n, <float*>qptr, qs,
32316 : */
32317 : /*else*/ {
32318 : {
32319 : #ifdef WITH_THREAD
32320 704 : PyThreadState *_save;
32321 704 : _save = NULL;
32322 704 : Py_UNBLOCK_THREADS
32323 704 : __Pyx_FastGIL_Remember();
32324 : #endif
32325 : /*try:*/ {
32326 :
32327 : /* "scipy/linalg/_decomp_update.pyx":1668
32328 : * else:
32329 : * with nogil:
32330 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
32331 : * info = qr_block_col_delete(m, o, n, <float*>qptr, qs,
32332 : * <float*>rptr, rs, k1, p1)
32333 : */
32334 704 : switch (__pyx_v_typecode) {
32335 176 : case NPY_FLOAT:
32336 :
32337 : /* "scipy/linalg/_decomp_update.pyx":1669
32338 : * with nogil:
32339 : * if typecode == cnp.NPY_FLOAT:
32340 : * info = qr_block_col_delete(m, o, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
32341 : * <float*>rptr, rs, k1, p1)
32342 : * elif typecode == cnp.NPY_DOUBLE:
32343 : */
32344 176 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
32345 :
32346 : /* "scipy/linalg/_decomp_update.pyx":1668
32347 : * else:
32348 : * with nogil:
32349 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
32350 : * info = qr_block_col_delete(m, o, n, <float*>qptr, qs,
32351 : * <float*>rptr, rs, k1, p1)
32352 : */
32353 176 : break;
32354 176 : case NPY_DOUBLE:
32355 :
32356 : /* "scipy/linalg/_decomp_update.pyx":1672
32357 : * <float*>rptr, rs, k1, p1)
32358 : * elif typecode == cnp.NPY_DOUBLE:
32359 : * info = qr_block_col_delete(m, o, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
32360 : * <double*>rptr, rs, k1, p1)
32361 : * elif typecode == cnp.NPY_CFLOAT:
32362 : */
32363 176 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
32364 :
32365 : /* "scipy/linalg/_decomp_update.pyx":1671
32366 : * info = qr_block_col_delete(m, o, n, <float*>qptr, qs,
32367 : * <float*>rptr, rs, k1, p1)
32368 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
32369 : * info = qr_block_col_delete(m, o, n, <double*>qptr, qs,
32370 : * <double*>rptr, rs, k1, p1)
32371 : */
32372 176 : break;
32373 176 : case NPY_CFLOAT:
32374 :
32375 : /* "scipy/linalg/_decomp_update.pyx":1675
32376 : * <double*>rptr, rs, k1, p1)
32377 : * elif typecode == cnp.NPY_CFLOAT:
32378 : * info = qr_block_col_delete(m, o, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
32379 : * <float_complex*>rptr, rs, k1, p1)
32380 : * else: # typecode == cnp.NPY_CDOUBLE:
32381 : */
32382 176 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
32383 :
32384 : /* "scipy/linalg/_decomp_update.pyx":1674
32385 : * info = qr_block_col_delete(m, o, n, <double*>qptr, qs,
32386 : * <double*>rptr, rs, k1, p1)
32387 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
32388 : * info = qr_block_col_delete(m, o, n, <float_complex*>qptr, qs,
32389 : * <float_complex*>rptr, rs, k1, p1)
32390 : */
32391 176 : break;
32392 176 : default:
32393 :
32394 : /* "scipy/linalg/_decomp_update.pyx":1678
32395 : * <float_complex*>rptr, rs, k1, p1)
32396 : * else: # typecode == cnp.NPY_CDOUBLE:
32397 : * info = qr_block_col_delete(m, o, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
32398 : * <double_complex*>rptr, rs, k1, p1)
32399 : * if info == MEMORY_ERROR:
32400 : */
32401 176 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_delete(__pyx_v_m, __pyx_v_o, __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k1, __pyx_v_p1);
32402 176 : break;
32403 : }
32404 : }
32405 :
32406 : /* "scipy/linalg/_decomp_update.pyx":1667
32407 : * <double_complex*>rptr, rs, k1)
32408 : * else:
32409 : * with nogil: # <<<<<<<<<<<<<<
32410 : * if typecode == cnp.NPY_FLOAT:
32411 : * info = qr_block_col_delete(m, o, n, <float*>qptr, qs,
32412 : */
32413 : /*finally:*/ {
32414 : /*normal exit:*/{
32415 : #ifdef WITH_THREAD
32416 704 : __Pyx_FastGIL_Forget();
32417 704 : Py_BLOCK_THREADS
32418 : #endif
32419 704 : goto __pyx_L32;
32420 : }
32421 704 : __pyx_L32:;
32422 : }
32423 : }
32424 :
32425 : /* "scipy/linalg/_decomp_update.pyx":1680
32426 : * info = qr_block_col_delete(m, o, n, <double_complex*>qptr, qs,
32427 : * <double_complex*>rptr, rs, k1, p1)
32428 : * if info == MEMORY_ERROR: # <<<<<<<<<<<<<<
32429 : * raise MemoryError('Unable to allocate memory for array')
32430 : * if economic:
32431 : */
32432 704 : __pyx_t_2 = (__pyx_v_info == __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR);
32433 704 : if (unlikely(__pyx_t_2)) {
32434 :
32435 : /* "scipy/linalg/_decomp_update.pyx":1681
32436 : * <double_complex*>rptr, rs, k1, p1)
32437 : * if info == MEMORY_ERROR:
32438 : * raise MemoryError('Unable to allocate memory for array') # <<<<<<<<<<<<<<
32439 : * if economic:
32440 : * return q1[:, :-p], r1[:-p, :-p]
32441 : */
32442 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1681, __pyx_L1_error)
32443 0 : __Pyx_GOTREF(__pyx_t_8);
32444 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
32445 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32446 0 : __PYX_ERR(0, 1681, __pyx_L1_error)
32447 :
32448 : /* "scipy/linalg/_decomp_update.pyx":1680
32449 : * info = qr_block_col_delete(m, o, n, <double_complex*>qptr, qs,
32450 : * <double_complex*>rptr, rs, k1, p1)
32451 : * if info == MEMORY_ERROR: # <<<<<<<<<<<<<<
32452 : * raise MemoryError('Unable to allocate memory for array')
32453 : * if economic:
32454 : */
32455 : }
32456 : }
32457 704 : __pyx_L26:;
32458 :
32459 : /* "scipy/linalg/_decomp_update.pyx":1682
32460 : * if info == MEMORY_ERROR:
32461 : * raise MemoryError('Unable to allocate memory for array')
32462 : * if economic: # <<<<<<<<<<<<<<
32463 : * return q1[:, :-p], r1[:-p, :-p]
32464 : * else:
32465 : */
32466 1192 : if (__pyx_v_economic) {
32467 :
32468 : /* "scipy/linalg/_decomp_update.pyx":1683
32469 : * raise MemoryError('Unable to allocate memory for array')
32470 : * if economic:
32471 : * return q1[:, :-p], r1[:-p, :-p] # <<<<<<<<<<<<<<
32472 : * else:
32473 : * return q1, r1[:, :-p]
32474 : */
32475 92 : __Pyx_XDECREF(__pyx_r);
32476 92 : __pyx_t_8 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
32477 92 : __Pyx_GOTREF(__pyx_t_8);
32478 92 : __pyx_t_3 = PySlice_New(Py_None, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1683, __pyx_L1_error)
32479 92 : __Pyx_GOTREF(__pyx_t_3);
32480 92 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32481 92 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
32482 92 : __Pyx_GOTREF(__pyx_t_8);
32483 92 : __Pyx_INCREF(__pyx_slice__16);
32484 92 : __Pyx_GIVEREF(__pyx_slice__16);
32485 92 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_slice__16)) __PYX_ERR(0, 1683, __pyx_L1_error);
32486 92 : __Pyx_GIVEREF(__pyx_t_3);
32487 92 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1683, __pyx_L1_error);
32488 92 : __pyx_t_3 = 0;
32489 92 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_q1), __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1683, __pyx_L1_error)
32490 92 : __Pyx_GOTREF(__pyx_t_3);
32491 92 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32492 92 : __pyx_t_8 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
32493 92 : __Pyx_GOTREF(__pyx_t_8);
32494 92 : __pyx_t_6 = PySlice_New(Py_None, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1683, __pyx_L1_error)
32495 92 : __Pyx_GOTREF(__pyx_t_6);
32496 92 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32497 92 : __pyx_t_8 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
32498 92 : __Pyx_GOTREF(__pyx_t_8);
32499 92 : __pyx_t_7 = PySlice_New(Py_None, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error)
32500 92 : __Pyx_GOTREF(__pyx_t_7);
32501 92 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32502 92 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
32503 92 : __Pyx_GOTREF(__pyx_t_8);
32504 92 : __Pyx_GIVEREF(__pyx_t_6);
32505 92 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1683, __pyx_L1_error);
32506 92 : __Pyx_GIVEREF(__pyx_t_7);
32507 92 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error);
32508 92 : __pyx_t_6 = 0;
32509 92 : __pyx_t_7 = 0;
32510 92 : __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error)
32511 92 : __Pyx_GOTREF(__pyx_t_7);
32512 92 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32513 92 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error)
32514 92 : __Pyx_GOTREF(__pyx_t_8);
32515 92 : __Pyx_GIVEREF(__pyx_t_3);
32516 92 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 1683, __pyx_L1_error);
32517 92 : __Pyx_GIVEREF(__pyx_t_7);
32518 92 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error);
32519 92 : __pyx_t_3 = 0;
32520 92 : __pyx_t_7 = 0;
32521 92 : __pyx_r = __pyx_t_8;
32522 92 : __pyx_t_8 = 0;
32523 92 : goto __pyx_L0;
32524 :
32525 : /* "scipy/linalg/_decomp_update.pyx":1682
32526 : * if info == MEMORY_ERROR:
32527 : * raise MemoryError('Unable to allocate memory for array')
32528 : * if economic: # <<<<<<<<<<<<<<
32529 : * return q1[:, :-p], r1[:-p, :-p]
32530 : * else:
32531 : */
32532 : }
32533 :
32534 : /* "scipy/linalg/_decomp_update.pyx":1685
32535 : * return q1[:, :-p], r1[:-p, :-p]
32536 : * else:
32537 : * return q1, r1[:, :-p] # <<<<<<<<<<<<<<
32538 : * else:
32539 : * raise ValueError("'which' must be either 'row' or 'col'")
32540 : */
32541 : /*else*/ {
32542 1100 : __Pyx_XDECREF(__pyx_r);
32543 1100 : __pyx_t_8 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1685, __pyx_L1_error)
32544 1100 : __Pyx_GOTREF(__pyx_t_8);
32545 1100 : __pyx_t_7 = PySlice_New(Py_None, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1685, __pyx_L1_error)
32546 1100 : __Pyx_GOTREF(__pyx_t_7);
32547 1100 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32548 1100 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1685, __pyx_L1_error)
32549 1100 : __Pyx_GOTREF(__pyx_t_8);
32550 1100 : __Pyx_INCREF(__pyx_slice__16);
32551 1100 : __Pyx_GIVEREF(__pyx_slice__16);
32552 1100 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_slice__16)) __PYX_ERR(0, 1685, __pyx_L1_error);
32553 1100 : __Pyx_GIVEREF(__pyx_t_7);
32554 1100 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 1685, __pyx_L1_error);
32555 1100 : __pyx_t_7 = 0;
32556 1100 : __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1685, __pyx_L1_error)
32557 1100 : __Pyx_GOTREF(__pyx_t_7);
32558 1100 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32559 1100 : __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1685, __pyx_L1_error)
32560 1100 : __Pyx_GOTREF(__pyx_t_8);
32561 1100 : __Pyx_INCREF((PyObject *)__pyx_v_q1);
32562 1100 : __Pyx_GIVEREF((PyObject *)__pyx_v_q1);
32563 1100 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_q1))) __PYX_ERR(0, 1685, __pyx_L1_error);
32564 1100 : __Pyx_GIVEREF(__pyx_t_7);
32565 1100 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 1685, __pyx_L1_error);
32566 1100 : __pyx_t_7 = 0;
32567 1100 : __pyx_r = __pyx_t_8;
32568 1100 : __pyx_t_8 = 0;
32569 1100 : goto __pyx_L0;
32570 : }
32571 :
32572 : /* "scipy/linalg/_decomp_update.pyx":1632
32573 : * <double_complex*>rptr, rs, k1, p1)
32574 : * return q1[p1:, p1:], r1[p1:, :]
32575 : * elif which == 'col': # <<<<<<<<<<<<<<
32576 : * # Special case single column removal to be more accepting of C ordered
32577 : * # inputs and to avoid allocating a work array for that case.
32578 : */
32579 : }
32580 :
32581 : /* "scipy/linalg/_decomp_update.pyx":1687
32582 : * return q1, r1[:, :-p]
32583 : * else:
32584 : * raise ValueError("'which' must be either 'row' or 'col'") # <<<<<<<<<<<<<<
32585 : *
32586 : * @cython.embedsignature(True)
32587 : */
32588 : /*else*/ {
32589 4 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1687, __pyx_L1_error)
32590 4 : __Pyx_GOTREF(__pyx_t_8);
32591 4 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
32592 4 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32593 4 : __PYX_ERR(0, 1687, __pyx_L1_error)
32594 : }
32595 :
32596 : /* "scipy/linalg/_decomp_update.pyx":1444
32597 : * return cnp.PyArray_DATA(arr)
32598 : *
32599 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
32600 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False,
32601 : * check_finite=True):
32602 : */
32603 :
32604 : /* function exit code */
32605 488 : __pyx_L1_error:;
32606 488 : __Pyx_XDECREF(__pyx_t_3);
32607 488 : __Pyx_XDECREF(__pyx_t_4);
32608 488 : __Pyx_XDECREF(__pyx_t_5);
32609 488 : __Pyx_XDECREF(__pyx_t_6);
32610 488 : __Pyx_XDECREF(__pyx_t_7);
32611 488 : __Pyx_XDECREF(__pyx_t_8);
32612 488 : __Pyx_XDECREF(__pyx_t_9);
32613 488 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
32614 488 : __pyx_r = NULL;
32615 3000 : __pyx_L0:;
32616 3000 : __Pyx_XDECREF((PyObject *)__pyx_v_q1);
32617 3000 : __Pyx_XDECREF((PyObject *)__pyx_v_r1);
32618 3000 : __Pyx_XDECREF(__pyx_v_qnew);
32619 3000 : __Pyx_XDECREF(__pyx_v_norm);
32620 3000 : __Pyx_XGIVEREF(__pyx_r);
32621 3000 : __Pyx_RefNannyFinishContext();
32622 3000 : return __pyx_r;
32623 : }
32624 :
32625 : /* "scipy/linalg/_decomp_update.pyx":1689
32626 : * raise ValueError("'which' must be either 'row' or 'col'")
32627 : *
32628 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
32629 : * def qr_insert(Q, R, u, k, which='row', rcond=None, overwrite_qru=False, check_finite=True):
32630 : * """
32631 : */
32632 :
32633 : /* Python wrapper */
32634 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_5qr_insert(PyObject *__pyx_self,
32635 : #if CYTHON_METH_FASTCALL
32636 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
32637 : #else
32638 : PyObject *__pyx_args, PyObject *__pyx_kwds
32639 : #endif
32640 : ); /*proto*/
32641 : PyDoc_STRVAR(__pyx_doc_5scipy_6linalg_14_decomp_update_4qr_insert, "qr_insert(Q, R, u, k, which=u'row', rcond=None, overwrite_qru=False, check_finite=True)\n\n QR update on row or column insertions\n\n If ``A = Q R`` is the QR factorization of ``A``, return the QR\n factorization of ``A`` where rows or columns have been inserted starting\n at row or column ``k``.\n\n Parameters\n ----------\n Q : (M, M) array_like\n Unitary/orthogonal matrix from the QR decomposition of A.\n R : (M, N) array_like\n Upper triangular matrix from the QR decomposition of A.\n u : (N,), (p, N), (M,), or (M, p) array_like\n Rows or columns to insert\n k : int\n Index before which `u` is to be inserted.\n which: {'row', 'col'}, optional\n Determines if rows or columns will be inserted, defaults to 'row'\n rcond : float\n Lower bound on the reciprocal condition number of ``Q`` augmented with\n ``u/||u||`` Only used when updating economic mode (thin, (M,N) (N,N))\n decompositions. If None, machine precision is used. Defaults to\n None.\n overwrite_qru : bool, optional\n If True, consume Q, R, and u, if possible, while performing the update,\n otherwise make copies as necessary. Defaults to False.\n check_finite : bool, optional\n Whether to check that the input matrices contain only finite numbers.\n Disabling may give a performance gain, but may result in problems\n (crashes, non-termination) if the inputs do contain infinities or NaNs.\n Default is True.\n\n Returns\n -------\n Q1 : ndarray\n Updated unitary/orthogonal factor\n R1 : ndarray\n Updated upper triangular factor\n\n Raises\n ------\n LinAlgError :\n If updating a (M,N) (N,N) factorization and the reciprocal condition\n number of Q augmented with ``u/||u||`` is smaller than rcond.\n\n See Also\n --------\n qr, qr_multiply, qr_delete, qr_update\n\n Notes\n -----\n This routine does no""t guarantee that the diagonal entries of ``R1`` are\n positive.\n\n .. versionadded:: 0.16.0\n\n References\n ----------\n\n .. [1] Golub, G. H. & Van Loan, C. F. Matrix Computations, 3rd Ed.\n (Johns Hopkins University Press, 1996).\n\n .. [2] Daniel, J. W., Gragg, W. B., Kaufman, L. & Stewart, G. W.\n Reorthogonalization and stable algorithms for updating the\n Gram-Schmidt QR factorization. Math. Comput. 30, 772-795 (1976).\n\n .. [3] Reichel, L. & Gragg, W. B. Algorithm 686: FORTRAN Subroutines for\n Updating the QR Decomposition. ACM Trans. Math. Softw. 16, 369-377\n (1990).\n\n Examples\n --------\n >>> import numpy as np\n >>> from scipy import linalg\n >>> a = np.array([[ 3., -2., -2.],\n ... [ 6., -7., 4.],\n ... [ 7., 8., -6.]])\n >>> q, r = linalg.qr(a)\n\n Given this QR decomposition, update q and r when 2 rows are inserted.\n\n >>> u = np.array([[ 6., -9., -3.],\n ... [ -3., 10., 1.]])\n >>> q1, r1 = linalg.qr_insert(q, r, u, 2, 'row')\n >>> q1\n array([[-0.25445668, 0.02246245, 0.18146236, -0.72798806, 0.60979671], # may vary (signs)\n [-0.50891336, 0.23226178, -0.82836478, -0.02837033, -0.00828114],\n [-0.50891336, 0.35715302, 0.38937158, 0.58110733, 0.35235345],\n [ 0.25445668, -0.52202743, -0.32165498, 0.36263239, 0.65404509],\n [-0.59373225, -0.73856549, 0.16065817, -0.0063658 , -0.27595554]])\n >>> r1\n array([[-11.78982612, 6.44623587, 3.81685018], # may vary (signs)\n [ 0. , -16.01393278, 3.72202865],\n [ 0. , 0. , -6.13010256],\n [ 0. , 0. , 0. ],\n [ 0. , 0. , 0. ]])\n\n The update is equivalent, but faster than the following.\n\n >>> a1 = np.insert(a, 2, u, 0)\n >>> a1\n array([[ 3""., -2., -2.],\n [ 6., -7., 4.],\n [ 6., -9., -3.],\n [ -3., 10., 1.],\n [ 7., 8., -6.]])\n >>> q_direct, r_direct = linalg.qr(a1)\n\n Check that we have equivalent results:\n\n >>> np.dot(q1, r1)\n array([[ 3., -2., -2.],\n [ 6., -7., 4.],\n [ 6., -9., -3.],\n [ -3., 10., 1.],\n [ 7., 8., -6.]])\n\n >>> np.allclose(np.dot(q1, r1), a1)\n True\n\n And the updated Q is still unitary:\n\n >>> np.allclose(np.dot(q1.T, q1), np.eye(5))\n True\n\n ");
32642 : static PyMethodDef __pyx_mdef_5scipy_6linalg_14_decomp_update_5qr_insert = {"qr_insert", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_14_decomp_update_5qr_insert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6linalg_14_decomp_update_4qr_insert};
32643 19806 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_5qr_insert(PyObject *__pyx_self,
32644 : #if CYTHON_METH_FASTCALL
32645 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
32646 : #else
32647 : PyObject *__pyx_args, PyObject *__pyx_kwds
32648 : #endif
32649 : ) {
32650 19806 : PyObject *__pyx_v_Q = 0;
32651 19806 : PyObject *__pyx_v_R = 0;
32652 19806 : PyObject *__pyx_v_u = 0;
32653 19806 : PyObject *__pyx_v_k = 0;
32654 19806 : PyObject *__pyx_v_which = 0;
32655 19806 : PyObject *__pyx_v_rcond = 0;
32656 19806 : PyObject *__pyx_v_overwrite_qru = 0;
32657 19806 : PyObject *__pyx_v_check_finite = 0;
32658 : #if !CYTHON_METH_FASTCALL
32659 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
32660 : #endif
32661 19806 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
32662 19806 : PyObject* values[8] = {0,0,0,0,0,0,0,0};
32663 19806 : int __pyx_lineno = 0;
32664 19806 : const char *__pyx_filename = NULL;
32665 19806 : int __pyx_clineno = 0;
32666 19806 : PyObject *__pyx_r = 0;
32667 : __Pyx_RefNannyDeclarations
32668 19806 : __Pyx_RefNannySetupContext("qr_insert (wrapper)", 0);
32669 : #if !CYTHON_METH_FASTCALL
32670 : #if CYTHON_ASSUME_SAFE_MACROS
32671 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
32672 : #else
32673 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
32674 : #endif
32675 : #endif
32676 19806 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
32677 : {
32678 19806 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Q,&__pyx_n_s_R,&__pyx_n_s_u,&__pyx_n_s_k,&__pyx_n_s_which,&__pyx_n_s_rcond,&__pyx_n_s_overwrite_qru,&__pyx_n_s_check_finite,0};
32679 19806 : values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject*)__pyx_n_u_row)));
32680 :
32681 : /* "scipy/linalg/_decomp_update.pyx":1690
32682 : *
32683 : * @cython.embedsignature(True)
32684 : * def qr_insert(Q, R, u, k, which='row', rcond=None, overwrite_qru=False, check_finite=True): # <<<<<<<<<<<<<<
32685 : * """
32686 : * QR update on row or column insertions
32687 : */
32688 19806 : values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
32689 19806 : values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
32690 19806 : values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True)));
32691 19806 : if (__pyx_kwds) {
32692 18970 : Py_ssize_t kw_args;
32693 18970 : switch (__pyx_nargs) {
32694 0 : case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
32695 0 : CYTHON_FALLTHROUGH;
32696 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
32697 0 : CYTHON_FALLTHROUGH;
32698 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
32699 2112 : CYTHON_FALLTHROUGH;
32700 2112 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
32701 18970 : CYTHON_FALLTHROUGH;
32702 18970 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
32703 18970 : CYTHON_FALLTHROUGH;
32704 18970 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
32705 18970 : CYTHON_FALLTHROUGH;
32706 18970 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
32707 18970 : CYTHON_FALLTHROUGH;
32708 18970 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
32709 18970 : CYTHON_FALLTHROUGH;
32710 18970 : case 0: break;
32711 0 : default: goto __pyx_L5_argtuple_error;
32712 : }
32713 18970 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
32714 18970 : switch (__pyx_nargs) {
32715 0 : case 0:
32716 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_Q)) != 0)) {
32717 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
32718 0 : kw_args--;
32719 : }
32720 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32721 0 : else goto __pyx_L5_argtuple_error;
32722 0 : CYTHON_FALLTHROUGH;
32723 : case 1:
32724 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) {
32725 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
32726 0 : kw_args--;
32727 : }
32728 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32729 : else {
32730 0 : __Pyx_RaiseArgtupleInvalid("qr_insert", 0, 4, 8, 1); __PYX_ERR(0, 1689, __pyx_L3_error)
32731 : }
32732 0 : CYTHON_FALLTHROUGH;
32733 : case 2:
32734 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) {
32735 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
32736 0 : kw_args--;
32737 : }
32738 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32739 : else {
32740 0 : __Pyx_RaiseArgtupleInvalid("qr_insert", 0, 4, 8, 2); __PYX_ERR(0, 1689, __pyx_L3_error)
32741 : }
32742 0 : CYTHON_FALLTHROUGH;
32743 : case 3:
32744 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
32745 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
32746 0 : kw_args--;
32747 : }
32748 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32749 : else {
32750 0 : __Pyx_RaiseArgtupleInvalid("qr_insert", 0, 4, 8, 3); __PYX_ERR(0, 1689, __pyx_L3_error)
32751 : }
32752 16858 : CYTHON_FALLTHROUGH;
32753 : case 4:
32754 16858 : if (kw_args > 0) {
32755 16858 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_which);
32756 16858 : if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
32757 64 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32758 : }
32759 18970 : CYTHON_FALLTHROUGH;
32760 : case 5:
32761 18970 : if (kw_args > 0) {
32762 18970 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rcond);
32763 18970 : if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
32764 18970 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32765 : }
32766 18970 : CYTHON_FALLTHROUGH;
32767 : case 6:
32768 18970 : if (kw_args > 0) {
32769 18970 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overwrite_qru);
32770 18970 : if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
32771 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32772 : }
32773 18970 : CYTHON_FALLTHROUGH;
32774 : case 7:
32775 18970 : if (kw_args > 0) {
32776 16794 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_finite);
32777 16794 : if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
32778 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1689, __pyx_L3_error)
32779 : }
32780 : }
32781 18970 : if (unlikely(kw_args > 0)) {
32782 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
32783 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "qr_insert") < 0)) __PYX_ERR(0, 1689, __pyx_L3_error)
32784 : }
32785 : } else {
32786 836 : switch (__pyx_nargs) {
32787 0 : case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
32788 0 : CYTHON_FALLTHROUGH;
32789 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
32790 0 : CYTHON_FALLTHROUGH;
32791 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
32792 412 : CYTHON_FALLTHROUGH;
32793 412 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
32794 836 : CYTHON_FALLTHROUGH;
32795 836 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
32796 836 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
32797 836 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
32798 836 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
32799 836 : break;
32800 0 : default: goto __pyx_L5_argtuple_error;
32801 : }
32802 : }
32803 19806 : __pyx_v_Q = values[0];
32804 19806 : __pyx_v_R = values[1];
32805 19806 : __pyx_v_u = values[2];
32806 19806 : __pyx_v_k = values[3];
32807 19806 : __pyx_v_which = values[4];
32808 19806 : __pyx_v_rcond = values[5];
32809 19806 : __pyx_v_overwrite_qru = values[6];
32810 19806 : __pyx_v_check_finite = values[7];
32811 : }
32812 19806 : goto __pyx_L6_skip;
32813 0 : __pyx_L5_argtuple_error:;
32814 0 : __Pyx_RaiseArgtupleInvalid("qr_insert", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 1689, __pyx_L3_error)
32815 19806 : __pyx_L6_skip:;
32816 19806 : goto __pyx_L4_argument_unpacking_done;
32817 0 : __pyx_L3_error:;
32818 : {
32819 0 : Py_ssize_t __pyx_temp;
32820 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
32821 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
32822 : }
32823 : }
32824 0 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
32825 0 : __Pyx_RefNannyFinishContext();
32826 0 : return NULL;
32827 19806 : __pyx_L4_argument_unpacking_done:;
32828 19806 : __pyx_r = __pyx_pf_5scipy_6linalg_14_decomp_update_4qr_insert(__pyx_self, __pyx_v_Q, __pyx_v_R, __pyx_v_u, __pyx_v_k, __pyx_v_which, __pyx_v_rcond, __pyx_v_overwrite_qru, __pyx_v_check_finite);
32829 :
32830 : /* "scipy/linalg/_decomp_update.pyx":1689
32831 : * raise ValueError("'which' must be either 'row' or 'col'")
32832 : *
32833 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
32834 : * def qr_insert(Q, R, u, k, which='row', rcond=None, overwrite_qru=False, check_finite=True):
32835 : * """
32836 : */
32837 :
32838 : /* function exit code */
32839 : {
32840 19806 : Py_ssize_t __pyx_temp;
32841 19806 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
32842 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
32843 : }
32844 : }
32845 : __Pyx_RefNannyFinishContext();
32846 : return __pyx_r;
32847 : }
32848 :
32849 19806 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update_4qr_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_u, PyObject *__pyx_v_k, PyObject *__pyx_v_which, PyObject *__pyx_v_rcond, PyObject *__pyx_v_overwrite_qru, PyObject *__pyx_v_check_finite) {
32850 19806 : int __pyx_v_chkfinite;
32851 19806 : int __pyx_v_overwrite;
32852 19806 : int __pyx_v_k1;
32853 19806 : PyObject *__pyx_r = NULL;
32854 : __Pyx_RefNannyDeclarations
32855 19806 : int __pyx_t_1;
32856 19806 : int __pyx_t_2;
32857 19806 : PyObject *__pyx_t_3 = NULL;
32858 19806 : int __pyx_lineno = 0;
32859 19806 : const char *__pyx_filename = NULL;
32860 19806 : int __pyx_clineno = 0;
32861 19806 : __Pyx_RefNannySetupContext("qr_insert", 1);
32862 :
32863 : /* "scipy/linalg/_decomp_update.pyx":1818
32864 : *
32865 : * """
32866 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qru # <<<<<<<<<<<<<<
32867 : * cdef int k1 = k
32868 : *
32869 : */
32870 19806 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_check_finite); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1818, __pyx_L1_error)
32871 19806 : __pyx_v_chkfinite = __pyx_t_1;
32872 19806 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_qru); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1818, __pyx_L1_error)
32873 19806 : __pyx_v_overwrite = __pyx_t_1;
32874 :
32875 : /* "scipy/linalg/_decomp_update.pyx":1819
32876 : * """
32877 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qru
32878 : * cdef int k1 = k # <<<<<<<<<<<<<<
32879 : *
32880 : * if which == 'row':
32881 : */
32882 19806 : __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1819, __pyx_L1_error)
32883 19806 : __pyx_v_k1 = __pyx_t_2;
32884 :
32885 : /* "scipy/linalg/_decomp_update.pyx":1821
32886 : * cdef int k1 = k
32887 : *
32888 : * if which == 'row': # <<<<<<<<<<<<<<
32889 : * if rcond is not None:
32890 : * raise ValueError("'rcond' is unused when inserting rows and "
32891 : */
32892 19806 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_which, __pyx_n_u_row, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1821, __pyx_L1_error)
32893 19806 : if (__pyx_t_1) {
32894 :
32895 : /* "scipy/linalg/_decomp_update.pyx":1822
32896 : *
32897 : * if which == 'row':
32898 : * if rcond is not None: # <<<<<<<<<<<<<<
32899 : * raise ValueError("'rcond' is unused when inserting rows and "
32900 : * "must be None")
32901 : */
32902 1460 : __pyx_t_1 = (__pyx_v_rcond != Py_None);
32903 1460 : if (unlikely(__pyx_t_1)) {
32904 :
32905 : /* "scipy/linalg/_decomp_update.pyx":1823
32906 : * if which == 'row':
32907 : * if rcond is not None:
32908 : * raise ValueError("'rcond' is unused when inserting rows and " # <<<<<<<<<<<<<<
32909 : * "must be None")
32910 : * return qr_insert_row(Q, R, u, k1, overwrite, chkfinite)
32911 : */
32912 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1823, __pyx_L1_error)
32913 0 : __Pyx_GOTREF(__pyx_t_3);
32914 0 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
32915 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32916 0 : __PYX_ERR(0, 1823, __pyx_L1_error)
32917 :
32918 : /* "scipy/linalg/_decomp_update.pyx":1822
32919 : *
32920 : * if which == 'row':
32921 : * if rcond is not None: # <<<<<<<<<<<<<<
32922 : * raise ValueError("'rcond' is unused when inserting rows and "
32923 : * "must be None")
32924 : */
32925 : }
32926 :
32927 : /* "scipy/linalg/_decomp_update.pyx":1825
32928 : * raise ValueError("'rcond' is unused when inserting rows and "
32929 : * "must be None")
32930 : * return qr_insert_row(Q, R, u, k1, overwrite, chkfinite) # <<<<<<<<<<<<<<
32931 : * elif which == 'col':
32932 : * return qr_insert_col(Q, R, u, k1, rcond, overwrite, chkfinite)
32933 : */
32934 1460 : __Pyx_XDECREF(__pyx_r);
32935 1460 : __pyx_t_3 = __pyx_f_5scipy_6linalg_14_decomp_update_qr_insert_row(__pyx_v_Q, __pyx_v_R, __pyx_v_u, __pyx_v_k1, __pyx_v_overwrite, __pyx_v_chkfinite); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1825, __pyx_L1_error)
32936 1256 : __Pyx_GOTREF(__pyx_t_3);
32937 1256 : __pyx_r = __pyx_t_3;
32938 1256 : __pyx_t_3 = 0;
32939 1256 : goto __pyx_L0;
32940 :
32941 : /* "scipy/linalg/_decomp_update.pyx":1821
32942 : * cdef int k1 = k
32943 : *
32944 : * if which == 'row': # <<<<<<<<<<<<<<
32945 : * if rcond is not None:
32946 : * raise ValueError("'rcond' is unused when inserting rows and "
32947 : */
32948 : }
32949 :
32950 : /* "scipy/linalg/_decomp_update.pyx":1826
32951 : * "must be None")
32952 : * return qr_insert_row(Q, R, u, k1, overwrite, chkfinite)
32953 : * elif which == 'col': # <<<<<<<<<<<<<<
32954 : * return qr_insert_col(Q, R, u, k1, rcond, overwrite, chkfinite)
32955 : * else:
32956 : */
32957 18346 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_which, __pyx_n_u_col, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1826, __pyx_L1_error)
32958 18346 : if (likely(__pyx_t_1)) {
32959 :
32960 : /* "scipy/linalg/_decomp_update.pyx":1827
32961 : * return qr_insert_row(Q, R, u, k1, overwrite, chkfinite)
32962 : * elif which == 'col':
32963 : * return qr_insert_col(Q, R, u, k1, rcond, overwrite, chkfinite) # <<<<<<<<<<<<<<
32964 : * else:
32965 : * raise ValueError("'which' must be either 'row' or 'col'")
32966 : */
32967 18346 : __Pyx_XDECREF(__pyx_r);
32968 18346 : __pyx_t_3 = __pyx_f_5scipy_6linalg_14_decomp_update_qr_insert_col(__pyx_v_Q, __pyx_v_R, __pyx_v_u, __pyx_v_k1, __pyx_v_rcond, __pyx_v_overwrite, __pyx_v_chkfinite); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1827, __pyx_L1_error)
32969 18138 : __Pyx_GOTREF(__pyx_t_3);
32970 18138 : __pyx_r = __pyx_t_3;
32971 18138 : __pyx_t_3 = 0;
32972 18138 : goto __pyx_L0;
32973 :
32974 : /* "scipy/linalg/_decomp_update.pyx":1826
32975 : * "must be None")
32976 : * return qr_insert_row(Q, R, u, k1, overwrite, chkfinite)
32977 : * elif which == 'col': # <<<<<<<<<<<<<<
32978 : * return qr_insert_col(Q, R, u, k1, rcond, overwrite, chkfinite)
32979 : * else:
32980 : */
32981 : }
32982 :
32983 : /* "scipy/linalg/_decomp_update.pyx":1829
32984 : * return qr_insert_col(Q, R, u, k1, rcond, overwrite, chkfinite)
32985 : * else:
32986 : * raise ValueError("'which' must be either 'row' or 'col'") # <<<<<<<<<<<<<<
32987 : *
32988 : * cdef qr_insert_row(Q, R, u, int k, bint overwrite_qru, bint check_finite):
32989 : */
32990 : /*else*/ {
32991 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1829, __pyx_L1_error)
32992 0 : __Pyx_GOTREF(__pyx_t_3);
32993 0 : __Pyx_Raise(__pyx_t_3, 0, 0, 0);
32994 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32995 0 : __PYX_ERR(0, 1829, __pyx_L1_error)
32996 : }
32997 :
32998 : /* "scipy/linalg/_decomp_update.pyx":1689
32999 : * raise ValueError("'which' must be either 'row' or 'col'")
33000 : *
33001 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
33002 : * def qr_insert(Q, R, u, k, which='row', rcond=None, overwrite_qru=False, check_finite=True):
33003 : * """
33004 : */
33005 :
33006 : /* function exit code */
33007 412 : __pyx_L1_error:;
33008 412 : __Pyx_XDECREF(__pyx_t_3);
33009 412 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
33010 412 : __pyx_r = NULL;
33011 19806 : __pyx_L0:;
33012 19806 : __Pyx_XGIVEREF(__pyx_r);
33013 19806 : __Pyx_RefNannyFinishContext();
33014 19806 : return __pyx_r;
33015 : }
33016 :
33017 : /* "scipy/linalg/_decomp_update.pyx":1831
33018 : * raise ValueError("'which' must be either 'row' or 'col'")
33019 : *
33020 : * cdef qr_insert_row(Q, R, u, int k, bint overwrite_qru, bint check_finite): # <<<<<<<<<<<<<<
33021 : * cdef cnp.ndarray q1, r1, u1, qnew, rnew
33022 : * cdef int j
33023 : */
33024 :
33025 1460 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_qr_insert_row(PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_u, int __pyx_v_k, int __pyx_v_overwrite_qru, int __pyx_v_check_finite) {
33026 1460 : PyArrayObject *__pyx_v_q1 = 0;
33027 1460 : PyArrayObject *__pyx_v_r1 = 0;
33028 1460 : PyArrayObject *__pyx_v_u1 = 0;
33029 1460 : PyArrayObject *__pyx_v_qnew = 0;
33030 1460 : PyArrayObject *__pyx_v_rnew = 0;
33031 1460 : int __pyx_v_j;
33032 1460 : int __pyx_v_u_flags;
33033 1460 : int __pyx_v_typecode;
33034 1460 : int __pyx_v_m;
33035 1460 : int __pyx_v_n;
33036 1460 : int __pyx_v_p;
33037 1460 : int __pyx_v_info;
33038 1460 : void *__pyx_v_qptr;
33039 1460 : void *__pyx_v_rptr;
33040 1460 : void *__pyx_v_uptr;
33041 1460 : int __pyx_v_qs[2];
33042 1460 : int __pyx_v_rs[2];
33043 1460 : int __pyx_v_us[2];
33044 1460 : npy_intp __pyx_v_shape[2];
33045 1460 : int __pyx_v_economic;
33046 1460 : PyObject *__pyx_r = NULL;
33047 : __Pyx_RefNannyDeclarations
33048 1460 : PyObject *__pyx_t_1 = NULL;
33049 1460 : PyObject *__pyx_t_2 = NULL;
33050 1460 : PyObject *__pyx_t_3 = NULL;
33051 1460 : PyObject *__pyx_t_4 = NULL;
33052 1460 : PyObject *__pyx_t_5 = NULL;
33053 1460 : PyObject *__pyx_t_6 = NULL;
33054 1460 : PyObject *__pyx_t_7 = NULL;
33055 1460 : int __pyx_t_8;
33056 1460 : int __pyx_t_9;
33057 1460 : int __pyx_t_10;
33058 1460 : int __pyx_t_11;
33059 1460 : int __pyx_t_12;
33060 1460 : int __pyx_lineno = 0;
33061 1460 : const char *__pyx_filename = NULL;
33062 1460 : int __pyx_clineno = 0;
33063 1460 : __Pyx_RefNannySetupContext("qr_insert_row", 1);
33064 :
33065 : /* "scipy/linalg/_decomp_update.pyx":1834
33066 : * cdef cnp.ndarray q1, r1, u1, qnew, rnew
33067 : * cdef int j
33068 : * cdef int u_flags = cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES # <<<<<<<<<<<<<<
33069 : * cdef int typecode, m, n, p, info
33070 : * cdef void* qptr
33071 : */
33072 1460 : __pyx_v_u_flags = (NPY_ARRAY_BEHAVED_NS | NPY_ARRAY_ELEMENTSTRIDES);
33073 :
33074 : /* "scipy/linalg/_decomp_update.pyx":1850
33075 : * # p full q alloc, r alloc, u any
33076 : *
33077 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, True, ARRAY_ANYORDER, # <<<<<<<<<<<<<<
33078 : * True, ARRAY_ANYORDER, check_finite)
33079 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
33080 : */
33081 1460 : __pyx_t_1 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(__pyx_v_Q, __pyx_v_R, 1, 0, 1, 0, __pyx_v_check_finite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1850, __pyx_L1_error)
33082 1324 : __Pyx_GOTREF(__pyx_t_1);
33083 1324 : if (likely(__pyx_t_1 != Py_None)) {
33084 1324 : PyObject* sequence = __pyx_t_1;
33085 1324 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
33086 1324 : if (unlikely(size != 6)) {
33087 0 : if (size > 6) __Pyx_RaiseTooManyValuesError(6);
33088 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
33089 0 : __PYX_ERR(0, 1850, __pyx_L1_error)
33090 : }
33091 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33092 1324 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
33093 1324 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
33094 1324 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
33095 1324 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
33096 1324 : __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
33097 1324 : __pyx_t_7 = PyTuple_GET_ITEM(sequence, 5);
33098 1324 : __Pyx_INCREF(__pyx_t_2);
33099 1324 : __Pyx_INCREF(__pyx_t_3);
33100 1324 : __Pyx_INCREF(__pyx_t_4);
33101 1324 : __Pyx_INCREF(__pyx_t_5);
33102 1324 : __Pyx_INCREF(__pyx_t_6);
33103 1324 : __Pyx_INCREF(__pyx_t_7);
33104 : #else
33105 : {
33106 : Py_ssize_t i;
33107 : PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
33108 : for (i=0; i < 6; i++) {
33109 : PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1850, __pyx_L1_error)
33110 : __Pyx_GOTREF(item);
33111 : *(temps[i]) = item;
33112 : }
33113 : }
33114 : #endif
33115 1324 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33116 : } else {
33117 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1850, __pyx_L1_error)
33118 : }
33119 1324 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1850, __pyx_L1_error)
33120 1324 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1850, __pyx_L1_error)
33121 1324 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)
33122 1324 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33123 1324 : __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)
33124 1324 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
33125 1324 : __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)
33126 1324 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
33127 1324 : __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)
33128 1324 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33129 1324 : __pyx_v_q1 = ((PyArrayObject *)__pyx_t_2);
33130 1324 : __pyx_t_2 = 0;
33131 1324 : __pyx_v_r1 = ((PyArrayObject *)__pyx_t_3);
33132 1324 : __pyx_t_3 = 0;
33133 1324 : __pyx_v_typecode = __pyx_t_8;
33134 1324 : __pyx_v_m = __pyx_t_9;
33135 1324 : __pyx_v_n = __pyx_t_10;
33136 1324 : __pyx_v_economic = __pyx_t_11;
33137 :
33138 : /* "scipy/linalg/_decomp_update.pyx":1852
33139 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, True, ARRAY_ANYORDER,
33140 : * True, ARRAY_ANYORDER, check_finite)
33141 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL) # <<<<<<<<<<<<<<
33142 : *
33143 : * if cnp.PyArray_TYPE(u1) != typecode:
33144 : */
33145 1324 : __pyx_t_1 = ((PyObject *)PyArray_CheckFromAny(__pyx_v_u, NULL, 0, 0, __pyx_v_u_flags, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error)
33146 1324 : __Pyx_GOTREF(__pyx_t_1);
33147 1324 : __pyx_v_u1 = ((PyArrayObject *)__pyx_t_1);
33148 1324 : __pyx_t_1 = 0;
33149 :
33150 : /* "scipy/linalg/_decomp_update.pyx":1854
33151 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
33152 : *
33153 : * if cnp.PyArray_TYPE(u1) != typecode: # <<<<<<<<<<<<<<
33154 : * raise ValueError("'u' must have the same type as 'Q' and 'R'")
33155 : *
33156 : */
33157 1324 : __pyx_t_11 = (PyArray_TYPE(__pyx_v_u1) != __pyx_v_typecode);
33158 1324 : if (unlikely(__pyx_t_11)) {
33159 :
33160 : /* "scipy/linalg/_decomp_update.pyx":1855
33161 : *
33162 : * if cnp.PyArray_TYPE(u1) != typecode:
33163 : * raise ValueError("'u' must have the same type as 'Q' and 'R'") # <<<<<<<<<<<<<<
33164 : *
33165 : * if not (-m <= k <= m):
33166 : */
33167 51 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1855, __pyx_L1_error)
33168 51 : __Pyx_GOTREF(__pyx_t_1);
33169 51 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
33170 51 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33171 51 : __PYX_ERR(0, 1855, __pyx_L1_error)
33172 :
33173 : /* "scipy/linalg/_decomp_update.pyx":1854
33174 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
33175 : *
33176 : * if cnp.PyArray_TYPE(u1) != typecode: # <<<<<<<<<<<<<<
33177 : * raise ValueError("'u' must have the same type as 'Q' and 'R'")
33178 : *
33179 : */
33180 : }
33181 :
33182 : /* "scipy/linalg/_decomp_update.pyx":1857
33183 : * raise ValueError("'u' must have the same type as 'Q' and 'R'")
33184 : *
33185 : * if not (-m <= k <= m): # <<<<<<<<<<<<<<
33186 : * raise ValueError("'k' is out of bounds")
33187 : *
33188 : */
33189 1273 : __pyx_t_11 = ((-__pyx_v_m) <= __pyx_v_k);
33190 1273 : if (__pyx_t_11) {
33191 1273 : __pyx_t_11 = (__pyx_v_k <= __pyx_v_m);
33192 : }
33193 1273 : __pyx_t_12 = (!__pyx_t_11);
33194 1273 : if (unlikely(__pyx_t_12)) {
33195 :
33196 : /* "scipy/linalg/_decomp_update.pyx":1858
33197 : *
33198 : * if not (-m <= k <= m):
33199 : * raise ValueError("'k' is out of bounds") # <<<<<<<<<<<<<<
33200 : *
33201 : * if k < 0:
33202 : */
33203 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error)
33204 0 : __Pyx_GOTREF(__pyx_t_1);
33205 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
33206 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33207 0 : __PYX_ERR(0, 1858, __pyx_L1_error)
33208 :
33209 : /* "scipy/linalg/_decomp_update.pyx":1857
33210 : * raise ValueError("'u' must have the same type as 'Q' and 'R'")
33211 : *
33212 : * if not (-m <= k <= m): # <<<<<<<<<<<<<<
33213 : * raise ValueError("'k' is out of bounds")
33214 : *
33215 : */
33216 : }
33217 :
33218 : /* "scipy/linalg/_decomp_update.pyx":1860
33219 : * raise ValueError("'k' is out of bounds")
33220 : *
33221 : * if k < 0: # <<<<<<<<<<<<<<
33222 : * k += m
33223 : *
33224 : */
33225 1273 : __pyx_t_12 = (__pyx_v_k < 0);
33226 1273 : if (__pyx_t_12) {
33227 :
33228 : /* "scipy/linalg/_decomp_update.pyx":1861
33229 : *
33230 : * if k < 0:
33231 : * k += m # <<<<<<<<<<<<<<
33232 : *
33233 : * if u1.ndim == 2:
33234 : */
33235 0 : __pyx_v_k = (__pyx_v_k + __pyx_v_m);
33236 :
33237 : /* "scipy/linalg/_decomp_update.pyx":1860
33238 : * raise ValueError("'k' is out of bounds")
33239 : *
33240 : * if k < 0: # <<<<<<<<<<<<<<
33241 : * k += m
33242 : *
33243 : */
33244 : }
33245 :
33246 : /* "scipy/linalg/_decomp_update.pyx":1863
33247 : * k += m
33248 : *
33249 : * if u1.ndim == 2: # <<<<<<<<<<<<<<
33250 : * p = u1.shape[0]
33251 : * if u1.shape[1] != n:
33252 : */
33253 1273 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) == 2);
33254 1273 : if (__pyx_t_12) {
33255 :
33256 : /* "scipy/linalg/_decomp_update.pyx":1864
33257 : *
33258 : * if u1.ndim == 2:
33259 : * p = u1.shape[0] # <<<<<<<<<<<<<<
33260 : * if u1.shape[1] != n:
33261 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33262 : */
33263 664 : __pyx_v_p = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[0]);
33264 :
33265 : /* "scipy/linalg/_decomp_update.pyx":1865
33266 : * if u1.ndim == 2:
33267 : * p = u1.shape[0]
33268 : * if u1.shape[1] != n: # <<<<<<<<<<<<<<
33269 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33270 : * "inserting rows. Found %s." %
33271 : */
33272 664 : __pyx_t_12 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[1]) != __pyx_v_n);
33273 664 : if (unlikely(__pyx_t_12)) {
33274 :
33275 : /* "scipy/linalg/_decomp_update.pyx":1868
33276 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33277 : * "inserting rows. Found %s." %
33278 : * str(getattr(u1, 'shape'))) # <<<<<<<<<<<<<<
33279 : * elif u1.ndim == 1:
33280 : * p = 1
33281 : */
33282 0 : __pyx_t_1 = __Pyx_GetAttr(((PyObject *)__pyx_v_u1), __pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1868, __pyx_L1_error)
33283 0 : __Pyx_GOTREF(__pyx_t_1);
33284 0 : __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1868, __pyx_L1_error)
33285 0 : __Pyx_GOTREF(__pyx_t_7);
33286 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33287 :
33288 : /* "scipy/linalg/_decomp_update.pyx":1867
33289 : * if u1.shape[1] != n:
33290 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33291 : * "inserting rows. Found %s." % # <<<<<<<<<<<<<<
33292 : * str(getattr(u1, 'shape')))
33293 : * elif u1.ndim == 1:
33294 : */
33295 0 : __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_u_should_be_either_N_or_p_N_whe, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1867, __pyx_L1_error)
33296 0 : __Pyx_GOTREF(__pyx_t_1);
33297 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33298 :
33299 : /* "scipy/linalg/_decomp_update.pyx":1866
33300 : * p = u1.shape[0]
33301 : * if u1.shape[1] != n:
33302 : * raise ValueError("'u' should be either (N,) or (p,N) when " # <<<<<<<<<<<<<<
33303 : * "inserting rows. Found %s." %
33304 : * str(getattr(u1, 'shape')))
33305 : */
33306 0 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1866, __pyx_L1_error)
33307 0 : __Pyx_GOTREF(__pyx_t_7);
33308 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33309 0 : __Pyx_Raise(__pyx_t_7, 0, 0, 0);
33310 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33311 0 : __PYX_ERR(0, 1866, __pyx_L1_error)
33312 :
33313 : /* "scipy/linalg/_decomp_update.pyx":1865
33314 : * if u1.ndim == 2:
33315 : * p = u1.shape[0]
33316 : * if u1.shape[1] != n: # <<<<<<<<<<<<<<
33317 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33318 : * "inserting rows. Found %s." %
33319 : */
33320 : }
33321 :
33322 : /* "scipy/linalg/_decomp_update.pyx":1863
33323 : * k += m
33324 : *
33325 : * if u1.ndim == 2: # <<<<<<<<<<<<<<
33326 : * p = u1.shape[0]
33327 : * if u1.shape[1] != n:
33328 : */
33329 664 : goto __pyx_L6;
33330 : }
33331 :
33332 : /* "scipy/linalg/_decomp_update.pyx":1869
33333 : * "inserting rows. Found %s." %
33334 : * str(getattr(u1, 'shape')))
33335 : * elif u1.ndim == 1: # <<<<<<<<<<<<<<
33336 : * p = 1
33337 : * if u1.shape[0] != n:
33338 : */
33339 609 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) == 1);
33340 609 : if (likely(__pyx_t_12)) {
33341 :
33342 : /* "scipy/linalg/_decomp_update.pyx":1870
33343 : * str(getattr(u1, 'shape')))
33344 : * elif u1.ndim == 1:
33345 : * p = 1 # <<<<<<<<<<<<<<
33346 : * if u1.shape[0] != n:
33347 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33348 : */
33349 605 : __pyx_v_p = 1;
33350 :
33351 : /* "scipy/linalg/_decomp_update.pyx":1871
33352 : * elif u1.ndim == 1:
33353 : * p = 1
33354 : * if u1.shape[0] != n: # <<<<<<<<<<<<<<
33355 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33356 : * "inserting rows. Found %s." %
33357 : */
33358 605 : __pyx_t_12 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[0]) != __pyx_v_n);
33359 605 : if (unlikely(__pyx_t_12)) {
33360 :
33361 : /* "scipy/linalg/_decomp_update.pyx":1874
33362 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33363 : * "inserting rows. Found %s." %
33364 : * str(getattr(u1, 'shape'))) # <<<<<<<<<<<<<<
33365 : * else:
33366 : * raise ValueError("'u' must be either 1- or 2-D")
33367 : */
33368 9 : __pyx_t_7 = __Pyx_GetAttr(((PyObject *)__pyx_v_u1), __pyx_n_u_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1874, __pyx_L1_error)
33369 9 : __Pyx_GOTREF(__pyx_t_7);
33370 9 : __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1874, __pyx_L1_error)
33371 9 : __Pyx_GOTREF(__pyx_t_1);
33372 9 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33373 :
33374 : /* "scipy/linalg/_decomp_update.pyx":1873
33375 : * if u1.shape[0] != n:
33376 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33377 : * "inserting rows. Found %s." % # <<<<<<<<<<<<<<
33378 : * str(getattr(u1, 'shape')))
33379 : * else:
33380 : */
33381 9 : __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_u_should_be_either_N_or_p_N_whe, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1873, __pyx_L1_error)
33382 9 : __Pyx_GOTREF(__pyx_t_7);
33383 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33384 :
33385 : /* "scipy/linalg/_decomp_update.pyx":1872
33386 : * p = 1
33387 : * if u1.shape[0] != n:
33388 : * raise ValueError("'u' should be either (N,) or (p,N) when " # <<<<<<<<<<<<<<
33389 : * "inserting rows. Found %s." %
33390 : * str(getattr(u1, 'shape')))
33391 : */
33392 9 : __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1872, __pyx_L1_error)
33393 9 : __Pyx_GOTREF(__pyx_t_1);
33394 9 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33395 9 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
33396 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33397 9 : __PYX_ERR(0, 1872, __pyx_L1_error)
33398 :
33399 : /* "scipy/linalg/_decomp_update.pyx":1871
33400 : * elif u1.ndim == 1:
33401 : * p = 1
33402 : * if u1.shape[0] != n: # <<<<<<<<<<<<<<
33403 : * raise ValueError("'u' should be either (N,) or (p,N) when "
33404 : * "inserting rows. Found %s." %
33405 : */
33406 : }
33407 :
33408 : /* "scipy/linalg/_decomp_update.pyx":1869
33409 : * "inserting rows. Found %s." %
33410 : * str(getattr(u1, 'shape')))
33411 : * elif u1.ndim == 1: # <<<<<<<<<<<<<<
33412 : * p = 1
33413 : * if u1.shape[0] != n:
33414 : */
33415 596 : goto __pyx_L6;
33416 : }
33417 :
33418 : /* "scipy/linalg/_decomp_update.pyx":1876
33419 : * str(getattr(u1, 'shape')))
33420 : * else:
33421 : * raise ValueError("'u' must be either 1- or 2-D") # <<<<<<<<<<<<<<
33422 : *
33423 : * u1 = validate_array(u1, check_finite)
33424 : */
33425 : /*else*/ {
33426 4 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error)
33427 4 : __Pyx_GOTREF(__pyx_t_1);
33428 4 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
33429 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33430 4 : __PYX_ERR(0, 1876, __pyx_L1_error)
33431 : }
33432 1260 : __pyx_L6:;
33433 :
33434 : /* "scipy/linalg/_decomp_update.pyx":1878
33435 : * raise ValueError("'u' must be either 1- or 2-D")
33436 : *
33437 : * u1 = validate_array(u1, check_finite) # <<<<<<<<<<<<<<
33438 : *
33439 : * if economic:
33440 : */
33441 1260 : __pyx_t_1 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_u1, __pyx_v_check_finite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1878, __pyx_L1_error)
33442 1256 : __Pyx_GOTREF(__pyx_t_1);
33443 1256 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1878, __pyx_L1_error)
33444 1256 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_1));
33445 1256 : __pyx_t_1 = 0;
33446 :
33447 : /* "scipy/linalg/_decomp_update.pyx":1880
33448 : * u1 = validate_array(u1, check_finite)
33449 : *
33450 : * if economic: # <<<<<<<<<<<<<<
33451 : * if not overwrite_qru:
33452 : * r1 = PyArray_FromArray(r1, NULL,
33453 : */
33454 1256 : if (__pyx_v_economic) {
33455 :
33456 : /* "scipy/linalg/_decomp_update.pyx":1881
33457 : *
33458 : * if economic:
33459 : * if not overwrite_qru: # <<<<<<<<<<<<<<
33460 : * r1 = PyArray_FromArray(r1, NULL,
33461 : * cnp.NPY_ARRAY_F_CONTIGUOUS | cnp.NPY_ARRAY_ENSURECOPY)
33462 : */
33463 80 : __pyx_t_12 = (!__pyx_v_overwrite_qru);
33464 80 : if (__pyx_t_12) {
33465 :
33466 : /* "scipy/linalg/_decomp_update.pyx":1882
33467 : * if economic:
33468 : * if not overwrite_qru:
33469 : * r1 = PyArray_FromArray(r1, NULL, # <<<<<<<<<<<<<<
33470 : * cnp.NPY_ARRAY_F_CONTIGUOUS | cnp.NPY_ARRAY_ENSURECOPY)
33471 : * u1 = PyArray_FromArray(u1, NULL,
33472 : */
33473 80 : __pyx_t_1 = ((PyObject *)PyArray_FromArray(__pyx_v_r1, NULL, (NPY_ARRAY_F_CONTIGUOUS | NPY_ARRAY_ENSURECOPY))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error)
33474 80 : __Pyx_GOTREF(__pyx_t_1);
33475 80 : __Pyx_DECREF_SET(__pyx_v_r1, ((PyArrayObject *)__pyx_t_1));
33476 80 : __pyx_t_1 = 0;
33477 :
33478 : /* "scipy/linalg/_decomp_update.pyx":1884
33479 : * r1 = PyArray_FromArray(r1, NULL,
33480 : * cnp.NPY_ARRAY_F_CONTIGUOUS | cnp.NPY_ARRAY_ENSURECOPY)
33481 : * u1 = PyArray_FromArray(u1, NULL, # <<<<<<<<<<<<<<
33482 : * cnp.NPY_ARRAY_F_CONTIGUOUS | cnp.NPY_ARRAY_ENSURECOPY)
33483 : *
33484 : */
33485 80 : __pyx_t_1 = ((PyObject *)PyArray_FromArray(__pyx_v_u1, NULL, (NPY_ARRAY_F_CONTIGUOUS | NPY_ARRAY_ENSURECOPY))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error)
33486 80 : __Pyx_GOTREF(__pyx_t_1);
33487 80 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_1));
33488 80 : __pyx_t_1 = 0;
33489 :
33490 : /* "scipy/linalg/_decomp_update.pyx":1881
33491 : *
33492 : * if economic:
33493 : * if not overwrite_qru: # <<<<<<<<<<<<<<
33494 : * r1 = PyArray_FromArray(r1, NULL,
33495 : * cnp.NPY_ARRAY_F_CONTIGUOUS | cnp.NPY_ARRAY_ENSURECOPY)
33496 : */
33497 : }
33498 :
33499 : /* "scipy/linalg/_decomp_update.pyx":1887
33500 : * cnp.NPY_ARRAY_F_CONTIGUOUS | cnp.NPY_ARRAY_ENSURECOPY)
33501 : *
33502 : * shape[0] = m + p # <<<<<<<<<<<<<<
33503 : * shape[1] = n + p
33504 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
33505 : */
33506 80 : (__pyx_v_shape[0]) = (__pyx_v_m + __pyx_v_p);
33507 :
33508 : /* "scipy/linalg/_decomp_update.pyx":1888
33509 : *
33510 : * shape[0] = m + p
33511 : * shape[1] = n + p # <<<<<<<<<<<<<<
33512 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
33513 : * qnew[:-p,:-p] = q1
33514 : */
33515 80 : (__pyx_v_shape[1]) = (__pyx_v_n + __pyx_v_p);
33516 :
33517 : /* "scipy/linalg/_decomp_update.pyx":1889
33518 : * shape[0] = m + p
33519 : * shape[1] = n + p
33520 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1) # <<<<<<<<<<<<<<
33521 : * qnew[:-p,:-p] = q1
33522 : * for j in range(p):
33523 : */
33524 80 : __pyx_t_1 = PyArray_ZEROS(2, __pyx_v_shape, __pyx_v_typecode, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1889, __pyx_L1_error)
33525 80 : __Pyx_GOTREF(__pyx_t_1);
33526 80 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1889, __pyx_L1_error)
33527 80 : __pyx_v_qnew = ((PyArrayObject *)__pyx_t_1);
33528 80 : __pyx_t_1 = 0;
33529 :
33530 : /* "scipy/linalg/_decomp_update.pyx":1890
33531 : * shape[1] = n + p
33532 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
33533 : * qnew[:-p,:-p] = q1 # <<<<<<<<<<<<<<
33534 : * for j in range(p):
33535 : * qnew[m+j, n+j] = 1
33536 : */
33537 80 : __pyx_t_1 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error)
33538 80 : __Pyx_GOTREF(__pyx_t_1);
33539 80 : __pyx_t_7 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1890, __pyx_L1_error)
33540 80 : __Pyx_GOTREF(__pyx_t_7);
33541 80 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33542 80 : __pyx_t_1 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error)
33543 80 : __Pyx_GOTREF(__pyx_t_1);
33544 80 : __pyx_t_6 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1890, __pyx_L1_error)
33545 80 : __Pyx_GOTREF(__pyx_t_6);
33546 80 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33547 80 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error)
33548 80 : __Pyx_GOTREF(__pyx_t_1);
33549 80 : __Pyx_GIVEREF(__pyx_t_7);
33550 80 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 1890, __pyx_L1_error);
33551 80 : __Pyx_GIVEREF(__pyx_t_6);
33552 80 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 1890, __pyx_L1_error);
33553 80 : __pyx_t_7 = 0;
33554 80 : __pyx_t_6 = 0;
33555 80 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qnew), __pyx_t_1, ((PyObject *)__pyx_v_q1)) < 0))) __PYX_ERR(0, 1890, __pyx_L1_error)
33556 80 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33557 :
33558 : /* "scipy/linalg/_decomp_update.pyx":1891
33559 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
33560 : * qnew[:-p,:-p] = q1
33561 : * for j in range(p): # <<<<<<<<<<<<<<
33562 : * qnew[m+j, n+j] = 1
33563 : *
33564 : */
33565 240 : __pyx_t_10 = __pyx_v_p;
33566 240 : __pyx_t_9 = __pyx_t_10;
33567 240 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
33568 160 : __pyx_v_j = __pyx_t_8;
33569 :
33570 : /* "scipy/linalg/_decomp_update.pyx":1892
33571 : * qnew[:-p,:-p] = q1
33572 : * for j in range(p):
33573 : * qnew[m+j, n+j] = 1 # <<<<<<<<<<<<<<
33574 : *
33575 : * if p == 1:
33576 : */
33577 160 : __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_m + __pyx_v_j)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L1_error)
33578 160 : __Pyx_GOTREF(__pyx_t_1);
33579 160 : __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_n + __pyx_v_j)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1892, __pyx_L1_error)
33580 160 : __Pyx_GOTREF(__pyx_t_6);
33581 160 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1892, __pyx_L1_error)
33582 160 : __Pyx_GOTREF(__pyx_t_7);
33583 160 : __Pyx_GIVEREF(__pyx_t_1);
33584 160 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L1_error);
33585 160 : __Pyx_GIVEREF(__pyx_t_6);
33586 160 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(0, 1892, __pyx_L1_error);
33587 160 : __pyx_t_1 = 0;
33588 160 : __pyx_t_6 = 0;
33589 160 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qnew), __pyx_t_7, __pyx_int_1) < 0))) __PYX_ERR(0, 1892, __pyx_L1_error)
33590 320 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33591 : }
33592 :
33593 : /* "scipy/linalg/_decomp_update.pyx":1894
33594 : * qnew[m+j, n+j] = 1
33595 : *
33596 : * if p == 1: # <<<<<<<<<<<<<<
33597 : * qptr = extract(qnew, qs)
33598 : * rptr = extract(r1, rs)
33599 : */
33600 80 : __pyx_t_12 = (__pyx_v_p == 1);
33601 80 : if (__pyx_t_12) {
33602 :
33603 : /* "scipy/linalg/_decomp_update.pyx":1895
33604 : *
33605 : * if p == 1:
33606 : * qptr = extract(qnew, qs) # <<<<<<<<<<<<<<
33607 : * rptr = extract(r1, rs)
33608 : * uptr = extract(u1, us)
33609 : */
33610 40 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_qnew, __pyx_v_qs);
33611 :
33612 : /* "scipy/linalg/_decomp_update.pyx":1896
33613 : * if p == 1:
33614 : * qptr = extract(qnew, qs)
33615 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
33616 : * uptr = extract(u1, us)
33617 : * with nogil:
33618 : */
33619 40 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
33620 :
33621 : /* "scipy/linalg/_decomp_update.pyx":1897
33622 : * qptr = extract(qnew, qs)
33623 : * rptr = extract(r1, rs)
33624 : * uptr = extract(u1, us) # <<<<<<<<<<<<<<
33625 : * with nogil:
33626 : * if typecode == cnp.NPY_FLOAT:
33627 : */
33628 40 : __pyx_v_uptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u1, __pyx_v_us);
33629 :
33630 : /* "scipy/linalg/_decomp_update.pyx":1898
33631 : * rptr = extract(r1, rs)
33632 : * uptr = extract(u1, us)
33633 : * with nogil: # <<<<<<<<<<<<<<
33634 : * if typecode == cnp.NPY_FLOAT:
33635 : * thin_qr_row_insert(m+p, n, <float*>qptr, qs,
33636 : */
33637 : {
33638 : #ifdef WITH_THREAD
33639 40 : PyThreadState *_save;
33640 40 : _save = NULL;
33641 40 : Py_UNBLOCK_THREADS
33642 40 : __Pyx_FastGIL_Remember();
33643 : #endif
33644 : /*try:*/ {
33645 :
33646 : /* "scipy/linalg/_decomp_update.pyx":1899
33647 : * uptr = extract(u1, us)
33648 : * with nogil:
33649 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
33650 : * thin_qr_row_insert(m+p, n, <float*>qptr, qs,
33651 : * <float*>rptr, rs, <float*>uptr, us, k)
33652 : */
33653 40 : switch (__pyx_v_typecode) {
33654 10 : case NPY_FLOAT:
33655 :
33656 : /* "scipy/linalg/_decomp_update.pyx":1900
33657 : * with nogil:
33658 : * if typecode == cnp.NPY_FLOAT:
33659 : * thin_qr_row_insert(m+p, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
33660 : * <float*>rptr, rs, <float*>uptr, us, k)
33661 : * elif typecode == cnp.NPY_DOUBLE:
33662 : */
33663 10 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, ((float *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k);
33664 :
33665 : /* "scipy/linalg/_decomp_update.pyx":1899
33666 : * uptr = extract(u1, us)
33667 : * with nogil:
33668 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
33669 : * thin_qr_row_insert(m+p, n, <float*>qptr, qs,
33670 : * <float*>rptr, rs, <float*>uptr, us, k)
33671 : */
33672 10 : break;
33673 10 : case NPY_DOUBLE:
33674 :
33675 : /* "scipy/linalg/_decomp_update.pyx":1903
33676 : * <float*>rptr, rs, <float*>uptr, us, k)
33677 : * elif typecode == cnp.NPY_DOUBLE:
33678 : * thin_qr_row_insert(m+p, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
33679 : * <double*>rptr, rs, <double*>uptr, us, k)
33680 : * elif typecode == cnp.NPY_CFLOAT:
33681 : */
33682 10 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, ((double *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k);
33683 :
33684 : /* "scipy/linalg/_decomp_update.pyx":1902
33685 : * thin_qr_row_insert(m+p, n, <float*>qptr, qs,
33686 : * <float*>rptr, rs, <float*>uptr, us, k)
33687 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
33688 : * thin_qr_row_insert(m+p, n, <double*>qptr, qs,
33689 : * <double*>rptr, rs, <double*>uptr, us, k)
33690 : */
33691 10 : break;
33692 10 : case NPY_CFLOAT:
33693 :
33694 : /* "scipy/linalg/_decomp_update.pyx":1906
33695 : * <double*>rptr, rs, <double*>uptr, us, k)
33696 : * elif typecode == cnp.NPY_CFLOAT:
33697 : * thin_qr_row_insert(m+p, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
33698 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k)
33699 : * else: # typecode == cnp.NPY_CDOUBLE:
33700 : */
33701 10 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_float_complex *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k);
33702 :
33703 : /* "scipy/linalg/_decomp_update.pyx":1905
33704 : * thin_qr_row_insert(m+p, n, <double*>qptr, qs,
33705 : * <double*>rptr, rs, <double*>uptr, us, k)
33706 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
33707 : * thin_qr_row_insert(m+p, n, <float_complex*>qptr, qs,
33708 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k)
33709 : */
33710 10 : break;
33711 10 : default:
33712 :
33713 : /* "scipy/linalg/_decomp_update.pyx":1909
33714 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k)
33715 : * else: # typecode == cnp.NPY_CDOUBLE:
33716 : * thin_qr_row_insert(m+p, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
33717 : * <double_complex*>rptr, rs, <double_complex*>uptr, us, k)
33718 : * else:
33719 : */
33720 10 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_double_complex *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k);
33721 10 : break;
33722 : }
33723 : }
33724 :
33725 : /* "scipy/linalg/_decomp_update.pyx":1898
33726 : * rptr = extract(r1, rs)
33727 : * uptr = extract(u1, us)
33728 : * with nogil: # <<<<<<<<<<<<<<
33729 : * if typecode == cnp.NPY_FLOAT:
33730 : * thin_qr_row_insert(m+p, n, <float*>qptr, qs,
33731 : */
33732 : /*finally:*/ {
33733 : /*normal exit:*/{
33734 : #ifdef WITH_THREAD
33735 40 : __Pyx_FastGIL_Forget();
33736 40 : Py_BLOCK_THREADS
33737 : #endif
33738 40 : goto __pyx_L16;
33739 : }
33740 40 : __pyx_L16:;
33741 : }
33742 : }
33743 :
33744 : /* "scipy/linalg/_decomp_update.pyx":1894
33745 : * qnew[m+j, n+j] = 1
33746 : *
33747 : * if p == 1: # <<<<<<<<<<<<<<
33748 : * qptr = extract(qnew, qs)
33749 : * rptr = extract(r1, rs)
33750 : */
33751 40 : goto __pyx_L13;
33752 : }
33753 :
33754 : /* "scipy/linalg/_decomp_update.pyx":1913
33755 : * else:
33756 : * # only copies if necessary.
33757 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
33758 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
33759 : * qptr = extract(qnew, qs)
33760 : */
33761 : /*else*/ {
33762 40 : __pyx_t_7 = ((PyObject *)PyArray_FromArray(__pyx_v_r1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1913, __pyx_L1_error)
33763 40 : __Pyx_GOTREF(__pyx_t_7);
33764 40 : __Pyx_DECREF_SET(__pyx_v_r1, ((PyArrayObject *)__pyx_t_7));
33765 40 : __pyx_t_7 = 0;
33766 :
33767 : /* "scipy/linalg/_decomp_update.pyx":1914
33768 : * # only copies if necessary.
33769 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
33770 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
33771 : * qptr = extract(qnew, qs)
33772 : * rptr = extract(r1, rs)
33773 : */
33774 40 : __pyx_t_7 = ((PyObject *)PyArray_FromArray(__pyx_v_u1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1914, __pyx_L1_error)
33775 40 : __Pyx_GOTREF(__pyx_t_7);
33776 40 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_7));
33777 40 : __pyx_t_7 = 0;
33778 :
33779 : /* "scipy/linalg/_decomp_update.pyx":1915
33780 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
33781 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
33782 : * qptr = extract(qnew, qs) # <<<<<<<<<<<<<<
33783 : * rptr = extract(r1, rs)
33784 : * uptr = extract(u1, us)
33785 : */
33786 40 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_qnew, __pyx_v_qs);
33787 :
33788 : /* "scipy/linalg/_decomp_update.pyx":1916
33789 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
33790 : * qptr = extract(qnew, qs)
33791 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
33792 : * uptr = extract(u1, us)
33793 : * with nogil:
33794 : */
33795 40 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
33796 :
33797 : /* "scipy/linalg/_decomp_update.pyx":1917
33798 : * qptr = extract(qnew, qs)
33799 : * rptr = extract(r1, rs)
33800 : * uptr = extract(u1, us) # <<<<<<<<<<<<<<
33801 : * with nogil:
33802 : * if typecode == cnp.NPY_FLOAT:
33803 : */
33804 40 : __pyx_v_uptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u1, __pyx_v_us);
33805 :
33806 : /* "scipy/linalg/_decomp_update.pyx":1918
33807 : * rptr = extract(r1, rs)
33808 : * uptr = extract(u1, us)
33809 : * with nogil: # <<<<<<<<<<<<<<
33810 : * if typecode == cnp.NPY_FLOAT:
33811 : * thin_qr_block_row_insert(m+p, n, <float*>qptr, qs,
33812 : */
33813 : {
33814 : #ifdef WITH_THREAD
33815 40 : PyThreadState *_save;
33816 40 : _save = NULL;
33817 40 : Py_UNBLOCK_THREADS
33818 40 : __Pyx_FastGIL_Remember();
33819 : #endif
33820 : /*try:*/ {
33821 :
33822 : /* "scipy/linalg/_decomp_update.pyx":1919
33823 : * uptr = extract(u1, us)
33824 : * with nogil:
33825 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
33826 : * thin_qr_block_row_insert(m+p, n, <float*>qptr, qs,
33827 : * <float*>rptr, rs, <float*>uptr, us, k, p)
33828 : */
33829 40 : switch (__pyx_v_typecode) {
33830 10 : case NPY_FLOAT:
33831 :
33832 : /* "scipy/linalg/_decomp_update.pyx":1920
33833 : * with nogil:
33834 : * if typecode == cnp.NPY_FLOAT:
33835 : * thin_qr_block_row_insert(m+p, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
33836 : * <float*>rptr, rs, <float*>uptr, us, k, p)
33837 : * elif typecode == cnp.NPY_DOUBLE:
33838 : */
33839 10 : (void)(__pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, ((float *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p));
33840 :
33841 : /* "scipy/linalg/_decomp_update.pyx":1919
33842 : * uptr = extract(u1, us)
33843 : * with nogil:
33844 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
33845 : * thin_qr_block_row_insert(m+p, n, <float*>qptr, qs,
33846 : * <float*>rptr, rs, <float*>uptr, us, k, p)
33847 : */
33848 10 : break;
33849 10 : case NPY_DOUBLE:
33850 :
33851 : /* "scipy/linalg/_decomp_update.pyx":1923
33852 : * <float*>rptr, rs, <float*>uptr, us, k, p)
33853 : * elif typecode == cnp.NPY_DOUBLE:
33854 : * thin_qr_block_row_insert(m+p, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
33855 : * <double*>rptr, rs, <double*>uptr, us, k, p)
33856 : * elif typecode == cnp.NPY_CFLOAT:
33857 : */
33858 10 : (void)(__pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, ((double *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p));
33859 :
33860 : /* "scipy/linalg/_decomp_update.pyx":1922
33861 : * thin_qr_block_row_insert(m+p, n, <float*>qptr, qs,
33862 : * <float*>rptr, rs, <float*>uptr, us, k, p)
33863 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
33864 : * thin_qr_block_row_insert(m+p, n, <double*>qptr, qs,
33865 : * <double*>rptr, rs, <double*>uptr, us, k, p)
33866 : */
33867 10 : break;
33868 10 : case NPY_CFLOAT:
33869 :
33870 : /* "scipy/linalg/_decomp_update.pyx":1926
33871 : * <double*>rptr, rs, <double*>uptr, us, k, p)
33872 : * elif typecode == cnp.NPY_CFLOAT:
33873 : * thin_qr_block_row_insert(m+p, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
33874 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k, p)
33875 : * else: # typecode == cnp.NPY_CDOUBLE:
33876 : */
33877 10 : (void)(__pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_float_complex *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p));
33878 :
33879 : /* "scipy/linalg/_decomp_update.pyx":1925
33880 : * thin_qr_block_row_insert(m+p, n, <double*>qptr, qs,
33881 : * <double*>rptr, rs, <double*>uptr, us, k, p)
33882 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
33883 : * thin_qr_block_row_insert(m+p, n, <float_complex*>qptr, qs,
33884 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k, p)
33885 : */
33886 10 : break;
33887 10 : default:
33888 :
33889 : /* "scipy/linalg/_decomp_update.pyx":1929
33890 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k, p)
33891 : * else: # typecode == cnp.NPY_CDOUBLE:
33892 : * thin_qr_block_row_insert(m+p, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
33893 : * <double_complex*>rptr, rs, <double_complex*>uptr, us, k, p)
33894 : * return qnew[:, :-p], r1
33895 : */
33896 10 : (void)(__pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_double_complex *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p));
33897 10 : break;
33898 : }
33899 : }
33900 :
33901 : /* "scipy/linalg/_decomp_update.pyx":1918
33902 : * rptr = extract(r1, rs)
33903 : * uptr = extract(u1, us)
33904 : * with nogil: # <<<<<<<<<<<<<<
33905 : * if typecode == cnp.NPY_FLOAT:
33906 : * thin_qr_block_row_insert(m+p, n, <float*>qptr, qs,
33907 : */
33908 : /*finally:*/ {
33909 : /*normal exit:*/{
33910 : #ifdef WITH_THREAD
33911 40 : __Pyx_FastGIL_Forget();
33912 40 : Py_BLOCK_THREADS
33913 : #endif
33914 40 : goto __pyx_L19;
33915 : }
33916 40 : __pyx_L19:;
33917 : }
33918 : }
33919 : }
33920 80 : __pyx_L13:;
33921 :
33922 : /* "scipy/linalg/_decomp_update.pyx":1931
33923 : * thin_qr_block_row_insert(m+p, n, <double_complex*>qptr, qs,
33924 : * <double_complex*>rptr, rs, <double_complex*>uptr, us, k, p)
33925 : * return qnew[:, :-p], r1 # <<<<<<<<<<<<<<
33926 : * else:
33927 : * shape[0] = m + p
33928 : */
33929 80 : __Pyx_XDECREF(__pyx_r);
33930 80 : __pyx_t_7 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1931, __pyx_L1_error)
33931 80 : __Pyx_GOTREF(__pyx_t_7);
33932 80 : __pyx_t_6 = PySlice_New(Py_None, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1931, __pyx_L1_error)
33933 80 : __Pyx_GOTREF(__pyx_t_6);
33934 80 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33935 80 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1931, __pyx_L1_error)
33936 80 : __Pyx_GOTREF(__pyx_t_7);
33937 80 : __Pyx_INCREF(__pyx_slice__16);
33938 80 : __Pyx_GIVEREF(__pyx_slice__16);
33939 80 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__16)) __PYX_ERR(0, 1931, __pyx_L1_error);
33940 80 : __Pyx_GIVEREF(__pyx_t_6);
33941 80 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6)) __PYX_ERR(0, 1931, __pyx_L1_error);
33942 80 : __pyx_t_6 = 0;
33943 80 : __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_qnew), __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1931, __pyx_L1_error)
33944 80 : __Pyx_GOTREF(__pyx_t_6);
33945 80 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33946 80 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1931, __pyx_L1_error)
33947 80 : __Pyx_GOTREF(__pyx_t_7);
33948 80 : __Pyx_GIVEREF(__pyx_t_6);
33949 80 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 1931, __pyx_L1_error);
33950 80 : __Pyx_INCREF((PyObject *)__pyx_v_r1);
33951 80 : __Pyx_GIVEREF((PyObject *)__pyx_v_r1);
33952 80 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_r1))) __PYX_ERR(0, 1931, __pyx_L1_error);
33953 80 : __pyx_t_6 = 0;
33954 80 : __pyx_r = __pyx_t_7;
33955 80 : __pyx_t_7 = 0;
33956 80 : goto __pyx_L0;
33957 :
33958 : /* "scipy/linalg/_decomp_update.pyx":1880
33959 : * u1 = validate_array(u1, check_finite)
33960 : *
33961 : * if economic: # <<<<<<<<<<<<<<
33962 : * if not overwrite_qru:
33963 : * r1 = PyArray_FromArray(r1, NULL,
33964 : */
33965 : }
33966 :
33967 : /* "scipy/linalg/_decomp_update.pyx":1933
33968 : * return qnew[:, :-p], r1
33969 : * else:
33970 : * shape[0] = m + p # <<<<<<<<<<<<<<
33971 : * shape[1] = m + p
33972 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
33973 : */
33974 : /*else*/ {
33975 1176 : (__pyx_v_shape[0]) = (__pyx_v_m + __pyx_v_p);
33976 :
33977 : /* "scipy/linalg/_decomp_update.pyx":1934
33978 : * else:
33979 : * shape[0] = m + p
33980 : * shape[1] = m + p # <<<<<<<<<<<<<<
33981 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
33982 : * shape[1] = n
33983 : */
33984 1176 : (__pyx_v_shape[1]) = (__pyx_v_m + __pyx_v_p);
33985 :
33986 : /* "scipy/linalg/_decomp_update.pyx":1935
33987 : * shape[0] = m + p
33988 : * shape[1] = m + p
33989 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1) # <<<<<<<<<<<<<<
33990 : * shape[1] = n
33991 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
33992 : */
33993 1176 : __pyx_t_7 = PyArray_ZEROS(2, __pyx_v_shape, __pyx_v_typecode, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1935, __pyx_L1_error)
33994 1176 : __Pyx_GOTREF(__pyx_t_7);
33995 1176 : if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1935, __pyx_L1_error)
33996 1176 : __pyx_v_qnew = ((PyArrayObject *)__pyx_t_7);
33997 1176 : __pyx_t_7 = 0;
33998 :
33999 : /* "scipy/linalg/_decomp_update.pyx":1936
34000 : * shape[1] = m + p
34001 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
34002 : * shape[1] = n # <<<<<<<<<<<<<<
34003 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
34004 : *
34005 : */
34006 1176 : (__pyx_v_shape[1]) = __pyx_v_n;
34007 :
34008 : /* "scipy/linalg/_decomp_update.pyx":1937
34009 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
34010 : * shape[1] = n
34011 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1) # <<<<<<<<<<<<<<
34012 : *
34013 : * rnew[:m,:] = r1
34014 : */
34015 1176 : __pyx_t_7 = PyArray_ZEROS(2, __pyx_v_shape, __pyx_v_typecode, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1937, __pyx_L1_error)
34016 1176 : __Pyx_GOTREF(__pyx_t_7);
34017 1176 : if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1937, __pyx_L1_error)
34018 1176 : __pyx_v_rnew = ((PyArrayObject *)__pyx_t_7);
34019 1176 : __pyx_t_7 = 0;
34020 :
34021 : /* "scipy/linalg/_decomp_update.pyx":1939
34022 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
34023 : *
34024 : * rnew[:m,:] = r1 # <<<<<<<<<<<<<<
34025 : * rnew[m:,:] = u1
34026 : * qnew[:-p,:-p] = q1;
34027 : */
34028 1176 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1939, __pyx_L1_error)
34029 1176 : __Pyx_GOTREF(__pyx_t_7);
34030 1176 : __pyx_t_6 = PySlice_New(Py_None, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1939, __pyx_L1_error)
34031 1176 : __Pyx_GOTREF(__pyx_t_6);
34032 1176 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34033 1176 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1939, __pyx_L1_error)
34034 1176 : __Pyx_GOTREF(__pyx_t_7);
34035 1176 : __Pyx_GIVEREF(__pyx_t_6);
34036 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 1939, __pyx_L1_error);
34037 1176 : __Pyx_INCREF(__pyx_slice__16);
34038 1176 : __Pyx_GIVEREF(__pyx_slice__16);
34039 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_slice__16)) __PYX_ERR(0, 1939, __pyx_L1_error);
34040 1176 : __pyx_t_6 = 0;
34041 1176 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rnew), __pyx_t_7, ((PyObject *)__pyx_v_r1)) < 0))) __PYX_ERR(0, 1939, __pyx_L1_error)
34042 1176 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34043 :
34044 : /* "scipy/linalg/_decomp_update.pyx":1940
34045 : *
34046 : * rnew[:m,:] = r1
34047 : * rnew[m:,:] = u1 # <<<<<<<<<<<<<<
34048 : * qnew[:-p,:-p] = q1;
34049 : * for j in range(m, m+p):
34050 : */
34051 1176 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1940, __pyx_L1_error)
34052 1176 : __Pyx_GOTREF(__pyx_t_7);
34053 1176 : __pyx_t_6 = PySlice_New(__pyx_t_7, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1940, __pyx_L1_error)
34054 1176 : __Pyx_GOTREF(__pyx_t_6);
34055 1176 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34056 1176 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1940, __pyx_L1_error)
34057 1176 : __Pyx_GOTREF(__pyx_t_7);
34058 1176 : __Pyx_GIVEREF(__pyx_t_6);
34059 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 1940, __pyx_L1_error);
34060 1176 : __Pyx_INCREF(__pyx_slice__16);
34061 1176 : __Pyx_GIVEREF(__pyx_slice__16);
34062 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_slice__16)) __PYX_ERR(0, 1940, __pyx_L1_error);
34063 1176 : __pyx_t_6 = 0;
34064 1176 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rnew), __pyx_t_7, ((PyObject *)__pyx_v_u1)) < 0))) __PYX_ERR(0, 1940, __pyx_L1_error)
34065 1176 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34066 :
34067 : /* "scipy/linalg/_decomp_update.pyx":1941
34068 : * rnew[:m,:] = r1
34069 : * rnew[m:,:] = u1
34070 : * qnew[:-p,:-p] = q1; # <<<<<<<<<<<<<<
34071 : * for j in range(m, m+p):
34072 : * qnew[j, j] = 1
34073 : */
34074 1176 : __pyx_t_7 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
34075 1176 : __Pyx_GOTREF(__pyx_t_7);
34076 1176 : __pyx_t_6 = PySlice_New(Py_None, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1941, __pyx_L1_error)
34077 1176 : __Pyx_GOTREF(__pyx_t_6);
34078 1176 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34079 1176 : __pyx_t_7 = __Pyx_PyInt_From_int((-__pyx_v_p)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
34080 1176 : __Pyx_GOTREF(__pyx_t_7);
34081 1176 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1941, __pyx_L1_error)
34082 1176 : __Pyx_GOTREF(__pyx_t_1);
34083 1176 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34084 1176 : __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
34085 1176 : __Pyx_GOTREF(__pyx_t_7);
34086 1176 : __Pyx_GIVEREF(__pyx_t_6);
34087 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 1941, __pyx_L1_error);
34088 1176 : __Pyx_GIVEREF(__pyx_t_1);
34089 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(0, 1941, __pyx_L1_error);
34090 1176 : __pyx_t_6 = 0;
34091 1176 : __pyx_t_1 = 0;
34092 1176 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qnew), __pyx_t_7, ((PyObject *)__pyx_v_q1)) < 0))) __PYX_ERR(0, 1941, __pyx_L1_error)
34093 1176 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34094 :
34095 : /* "scipy/linalg/_decomp_update.pyx":1942
34096 : * rnew[m:,:] = u1
34097 : * qnew[:-p,:-p] = q1;
34098 : * for j in range(m, m+p): # <<<<<<<<<<<<<<
34099 : * qnew[j, j] = 1
34100 : *
34101 : */
34102 3784 : __pyx_t_10 = (__pyx_v_m + __pyx_v_p);
34103 3784 : __pyx_t_9 = __pyx_t_10;
34104 3784 : for (__pyx_t_8 = __pyx_v_m; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
34105 2608 : __pyx_v_j = __pyx_t_8;
34106 :
34107 : /* "scipy/linalg/_decomp_update.pyx":1943
34108 : * qnew[:-p,:-p] = q1;
34109 : * for j in range(m, m+p):
34110 : * qnew[j, j] = 1 # <<<<<<<<<<<<<<
34111 : *
34112 : * qptr = extract(qnew, qs)
34113 : */
34114 2608 : __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1943, __pyx_L1_error)
34115 2608 : __Pyx_GOTREF(__pyx_t_7);
34116 2608 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1943, __pyx_L1_error)
34117 2608 : __Pyx_GOTREF(__pyx_t_1);
34118 2608 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1943, __pyx_L1_error)
34119 2608 : __Pyx_GOTREF(__pyx_t_6);
34120 2608 : __Pyx_GIVEREF(__pyx_t_7);
34121 2608 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7)) __PYX_ERR(0, 1943, __pyx_L1_error);
34122 2608 : __Pyx_GIVEREF(__pyx_t_1);
34123 2608 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(0, 1943, __pyx_L1_error);
34124 2608 : __pyx_t_7 = 0;
34125 2608 : __pyx_t_1 = 0;
34126 2608 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qnew), __pyx_t_6, __pyx_int_1) < 0))) __PYX_ERR(0, 1943, __pyx_L1_error)
34127 5216 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34128 : }
34129 :
34130 : /* "scipy/linalg/_decomp_update.pyx":1945
34131 : * qnew[j, j] = 1
34132 : *
34133 : * qptr = extract(qnew, qs) # <<<<<<<<<<<<<<
34134 : * rptr = extract(rnew, rs)
34135 : * if p == 1:
34136 : */
34137 1176 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_qnew, __pyx_v_qs);
34138 :
34139 : /* "scipy/linalg/_decomp_update.pyx":1946
34140 : *
34141 : * qptr = extract(qnew, qs)
34142 : * rptr = extract(rnew, rs) # <<<<<<<<<<<<<<
34143 : * if p == 1:
34144 : * with nogil:
34145 : */
34146 1176 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_rnew, __pyx_v_rs);
34147 :
34148 : /* "scipy/linalg/_decomp_update.pyx":1947
34149 : * qptr = extract(qnew, qs)
34150 : * rptr = extract(rnew, rs)
34151 : * if p == 1: # <<<<<<<<<<<<<<
34152 : * with nogil:
34153 : * if typecode == cnp.NPY_FLOAT:
34154 : */
34155 1176 : __pyx_t_12 = (__pyx_v_p == 1);
34156 1176 : if (__pyx_t_12) {
34157 :
34158 : /* "scipy/linalg/_decomp_update.pyx":1948
34159 : * rptr = extract(rnew, rs)
34160 : * if p == 1:
34161 : * with nogil: # <<<<<<<<<<<<<<
34162 : * if typecode == cnp.NPY_FLOAT:
34163 : * qr_row_insert(m+p, n, <float*>qptr, qs,
34164 : */
34165 : {
34166 : #ifdef WITH_THREAD
34167 556 : PyThreadState *_save;
34168 556 : _save = NULL;
34169 556 : Py_UNBLOCK_THREADS
34170 556 : __Pyx_FastGIL_Remember();
34171 : #endif
34172 : /*try:*/ {
34173 :
34174 : /* "scipy/linalg/_decomp_update.pyx":1949
34175 : * if p == 1:
34176 : * with nogil:
34177 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
34178 : * qr_row_insert(m+p, n, <float*>qptr, qs,
34179 : * <float*>rptr, rs, k)
34180 : */
34181 556 : switch (__pyx_v_typecode) {
34182 139 : case NPY_FLOAT:
34183 :
34184 : /* "scipy/linalg/_decomp_update.pyx":1950
34185 : * with nogil:
34186 : * if typecode == cnp.NPY_FLOAT:
34187 : * qr_row_insert(m+p, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
34188 : * <float*>rptr, rs, k)
34189 : * elif typecode == cnp.NPY_DOUBLE:
34190 : */
34191 139 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
34192 :
34193 : /* "scipy/linalg/_decomp_update.pyx":1949
34194 : * if p == 1:
34195 : * with nogil:
34196 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
34197 : * qr_row_insert(m+p, n, <float*>qptr, qs,
34198 : * <float*>rptr, rs, k)
34199 : */
34200 139 : break;
34201 139 : case NPY_DOUBLE:
34202 :
34203 : /* "scipy/linalg/_decomp_update.pyx":1953
34204 : * <float*>rptr, rs, k)
34205 : * elif typecode == cnp.NPY_DOUBLE:
34206 : * qr_row_insert(m+p, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
34207 : * <double*>rptr, rs, k)
34208 : * elif typecode == cnp.NPY_CFLOAT:
34209 : */
34210 139 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
34211 :
34212 : /* "scipy/linalg/_decomp_update.pyx":1952
34213 : * qr_row_insert(m+p, n, <float*>qptr, qs,
34214 : * <float*>rptr, rs, k)
34215 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
34216 : * qr_row_insert(m+p, n, <double*>qptr, qs,
34217 : * <double*>rptr, rs, k)
34218 : */
34219 139 : break;
34220 139 : case NPY_CFLOAT:
34221 :
34222 : /* "scipy/linalg/_decomp_update.pyx":1956
34223 : * <double*>rptr, rs, k)
34224 : * elif typecode == cnp.NPY_CFLOAT:
34225 : * qr_row_insert(m+p, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
34226 : * <float_complex*>rptr, rs, k)
34227 : * else: # typecode == cnp.NPY_CDOUBLE:
34228 : */
34229 139 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
34230 :
34231 : /* "scipy/linalg/_decomp_update.pyx":1955
34232 : * qr_row_insert(m+p, n, <double*>qptr, qs,
34233 : * <double*>rptr, rs, k)
34234 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
34235 : * qr_row_insert(m+p, n, <float_complex*>qptr, qs,
34236 : * <float_complex*>rptr, rs, k)
34237 : */
34238 139 : break;
34239 139 : default:
34240 :
34241 : /* "scipy/linalg/_decomp_update.pyx":1959
34242 : * <float_complex*>rptr, rs, k)
34243 : * else: # typecode == cnp.NPY_CDOUBLE:
34244 : * qr_row_insert(m+p, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
34245 : * <double_complex*>rptr, rs, k)
34246 : * else:
34247 : */
34248 139 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
34249 139 : break;
34250 : }
34251 : }
34252 :
34253 : /* "scipy/linalg/_decomp_update.pyx":1948
34254 : * rptr = extract(rnew, rs)
34255 : * if p == 1:
34256 : * with nogil: # <<<<<<<<<<<<<<
34257 : * if typecode == cnp.NPY_FLOAT:
34258 : * qr_row_insert(m+p, n, <float*>qptr, qs,
34259 : */
34260 : /*finally:*/ {
34261 : /*normal exit:*/{
34262 : #ifdef WITH_THREAD
34263 556 : __Pyx_FastGIL_Forget();
34264 556 : Py_BLOCK_THREADS
34265 : #endif
34266 556 : goto __pyx_L25;
34267 : }
34268 556 : __pyx_L25:;
34269 : }
34270 : }
34271 :
34272 : /* "scipy/linalg/_decomp_update.pyx":1947
34273 : * qptr = extract(qnew, qs)
34274 : * rptr = extract(rnew, rs)
34275 : * if p == 1: # <<<<<<<<<<<<<<
34276 : * with nogil:
34277 : * if typecode == cnp.NPY_FLOAT:
34278 : */
34279 556 : goto __pyx_L22;
34280 : }
34281 :
34282 : /* "scipy/linalg/_decomp_update.pyx":1962
34283 : * <double_complex*>rptr, rs, k)
34284 : * else:
34285 : * with nogil: # <<<<<<<<<<<<<<
34286 : * if typecode == cnp.NPY_FLOAT:
34287 : * info = qr_block_row_insert(m+p, n, <float*>qptr, qs,
34288 : */
34289 : /*else*/ {
34290 : {
34291 : #ifdef WITH_THREAD
34292 620 : PyThreadState *_save;
34293 620 : _save = NULL;
34294 620 : Py_UNBLOCK_THREADS
34295 620 : __Pyx_FastGIL_Remember();
34296 : #endif
34297 : /*try:*/ {
34298 :
34299 : /* "scipy/linalg/_decomp_update.pyx":1963
34300 : * else:
34301 : * with nogil:
34302 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
34303 : * info = qr_block_row_insert(m+p, n, <float*>qptr, qs,
34304 : * <float*>rptr, rs, k, p)
34305 : */
34306 620 : switch (__pyx_v_typecode) {
34307 155 : case NPY_FLOAT:
34308 :
34309 : /* "scipy/linalg/_decomp_update.pyx":1964
34310 : * with nogil:
34311 : * if typecode == cnp.NPY_FLOAT:
34312 : * info = qr_block_row_insert(m+p, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
34313 : * <float*>rptr, rs, k, p)
34314 : * elif typecode == cnp.NPY_DOUBLE:
34315 : */
34316 155 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
34317 :
34318 : /* "scipy/linalg/_decomp_update.pyx":1963
34319 : * else:
34320 : * with nogil:
34321 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
34322 : * info = qr_block_row_insert(m+p, n, <float*>qptr, qs,
34323 : * <float*>rptr, rs, k, p)
34324 : */
34325 155 : break;
34326 155 : case NPY_DOUBLE:
34327 :
34328 : /* "scipy/linalg/_decomp_update.pyx":1967
34329 : * <float*>rptr, rs, k, p)
34330 : * elif typecode == cnp.NPY_DOUBLE:
34331 : * info = qr_block_row_insert(m+p, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
34332 : * <double*>rptr, rs, k, p)
34333 : * elif typecode == cnp.NPY_CFLOAT:
34334 : */
34335 155 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
34336 :
34337 : /* "scipy/linalg/_decomp_update.pyx":1966
34338 : * info = qr_block_row_insert(m+p, n, <float*>qptr, qs,
34339 : * <float*>rptr, rs, k, p)
34340 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
34341 : * info = qr_block_row_insert(m+p, n, <double*>qptr, qs,
34342 : * <double*>rptr, rs, k, p)
34343 : */
34344 155 : break;
34345 155 : case NPY_CFLOAT:
34346 :
34347 : /* "scipy/linalg/_decomp_update.pyx":1970
34348 : * <double*>rptr, rs, k, p)
34349 : * elif typecode == cnp.NPY_CFLOAT:
34350 : * info = qr_block_row_insert(m+p, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
34351 : * <float_complex*>rptr, rs, k, p)
34352 : * else: # typecode == cnp.NPY_CDOUBLE:
34353 : */
34354 155 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
34355 :
34356 : /* "scipy/linalg/_decomp_update.pyx":1969
34357 : * info = qr_block_row_insert(m+p, n, <double*>qptr, qs,
34358 : * <double*>rptr, rs, k, p)
34359 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
34360 : * info = qr_block_row_insert(m+p, n, <float_complex*>qptr, qs,
34361 : * <float_complex*>rptr, rs, k, p)
34362 : */
34363 155 : break;
34364 155 : default:
34365 :
34366 : /* "scipy/linalg/_decomp_update.pyx":1973
34367 : * <float_complex*>rptr, rs, k, p)
34368 : * else: # typecode == cnp.NPY_CDOUBLE:
34369 : * info = qr_block_row_insert(m+p, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
34370 : * <double_complex*>rptr, rs, k, p)
34371 : * if info == MEMORY_ERROR:
34372 : */
34373 155 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_row_insert((__pyx_v_m + __pyx_v_p), __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
34374 155 : break;
34375 : }
34376 : }
34377 :
34378 : /* "scipy/linalg/_decomp_update.pyx":1962
34379 : * <double_complex*>rptr, rs, k)
34380 : * else:
34381 : * with nogil: # <<<<<<<<<<<<<<
34382 : * if typecode == cnp.NPY_FLOAT:
34383 : * info = qr_block_row_insert(m+p, n, <float*>qptr, qs,
34384 : */
34385 : /*finally:*/ {
34386 : /*normal exit:*/{
34387 : #ifdef WITH_THREAD
34388 620 : __Pyx_FastGIL_Forget();
34389 620 : Py_BLOCK_THREADS
34390 : #endif
34391 620 : goto __pyx_L28;
34392 : }
34393 620 : __pyx_L28:;
34394 : }
34395 : }
34396 :
34397 : /* "scipy/linalg/_decomp_update.pyx":1975
34398 : * info = qr_block_row_insert(m+p, n, <double_complex*>qptr, qs,
34399 : * <double_complex*>rptr, rs, k, p)
34400 : * if info == MEMORY_ERROR: # <<<<<<<<<<<<<<
34401 : * raise MemoryError('Unable to allocate memory for array')
34402 : * return qnew, rnew
34403 : */
34404 620 : __pyx_t_12 = (__pyx_v_info == __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR);
34405 620 : if (unlikely(__pyx_t_12)) {
34406 :
34407 : /* "scipy/linalg/_decomp_update.pyx":1976
34408 : * <double_complex*>rptr, rs, k, p)
34409 : * if info == MEMORY_ERROR:
34410 : * raise MemoryError('Unable to allocate memory for array') # <<<<<<<<<<<<<<
34411 : * return qnew, rnew
34412 : *
34413 : */
34414 0 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1976, __pyx_L1_error)
34415 0 : __Pyx_GOTREF(__pyx_t_6);
34416 0 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
34417 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34418 0 : __PYX_ERR(0, 1976, __pyx_L1_error)
34419 :
34420 : /* "scipy/linalg/_decomp_update.pyx":1975
34421 : * info = qr_block_row_insert(m+p, n, <double_complex*>qptr, qs,
34422 : * <double_complex*>rptr, rs, k, p)
34423 : * if info == MEMORY_ERROR: # <<<<<<<<<<<<<<
34424 : * raise MemoryError('Unable to allocate memory for array')
34425 : * return qnew, rnew
34426 : */
34427 : }
34428 : }
34429 620 : __pyx_L22:;
34430 :
34431 : /* "scipy/linalg/_decomp_update.pyx":1977
34432 : * if info == MEMORY_ERROR:
34433 : * raise MemoryError('Unable to allocate memory for array')
34434 : * return qnew, rnew # <<<<<<<<<<<<<<
34435 : *
34436 : * cdef qr_insert_col(Q, R, u, int k, rcond, bint overwrite_qru, bint check_finite):
34437 : */
34438 1176 : __Pyx_XDECREF(__pyx_r);
34439 1176 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1977, __pyx_L1_error)
34440 1176 : __Pyx_GOTREF(__pyx_t_6);
34441 1176 : __Pyx_INCREF((PyObject *)__pyx_v_qnew);
34442 1176 : __Pyx_GIVEREF((PyObject *)__pyx_v_qnew);
34443 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_qnew))) __PYX_ERR(0, 1977, __pyx_L1_error);
34444 1176 : __Pyx_INCREF((PyObject *)__pyx_v_rnew);
34445 1176 : __Pyx_GIVEREF((PyObject *)__pyx_v_rnew);
34446 1176 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_rnew))) __PYX_ERR(0, 1977, __pyx_L1_error);
34447 1176 : __pyx_r = __pyx_t_6;
34448 1176 : __pyx_t_6 = 0;
34449 1176 : goto __pyx_L0;
34450 : }
34451 :
34452 : /* "scipy/linalg/_decomp_update.pyx":1831
34453 : * raise ValueError("'which' must be either 'row' or 'col'")
34454 : *
34455 : * cdef qr_insert_row(Q, R, u, int k, bint overwrite_qru, bint check_finite): # <<<<<<<<<<<<<<
34456 : * cdef cnp.ndarray q1, r1, u1, qnew, rnew
34457 : * cdef int j
34458 : */
34459 :
34460 : /* function exit code */
34461 204 : __pyx_L1_error:;
34462 204 : __Pyx_XDECREF(__pyx_t_1);
34463 204 : __Pyx_XDECREF(__pyx_t_2);
34464 204 : __Pyx_XDECREF(__pyx_t_3);
34465 204 : __Pyx_XDECREF(__pyx_t_4);
34466 204 : __Pyx_XDECREF(__pyx_t_5);
34467 204 : __Pyx_XDECREF(__pyx_t_6);
34468 204 : __Pyx_XDECREF(__pyx_t_7);
34469 204 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_insert_row", __pyx_clineno, __pyx_lineno, __pyx_filename);
34470 204 : __pyx_r = 0;
34471 1460 : __pyx_L0:;
34472 1460 : __Pyx_XDECREF((PyObject *)__pyx_v_q1);
34473 1460 : __Pyx_XDECREF((PyObject *)__pyx_v_r1);
34474 1460 : __Pyx_XDECREF((PyObject *)__pyx_v_u1);
34475 1460 : __Pyx_XDECREF((PyObject *)__pyx_v_qnew);
34476 1460 : __Pyx_XDECREF((PyObject *)__pyx_v_rnew);
34477 1460 : __Pyx_XGIVEREF(__pyx_r);
34478 1460 : __Pyx_RefNannyFinishContext();
34479 1460 : return __pyx_r;
34480 : }
34481 :
34482 : /* "scipy/linalg/_decomp_update.pyx":1979
34483 : * return qnew, rnew
34484 : *
34485 : * cdef qr_insert_col(Q, R, u, int k, rcond, bint overwrite_qru, bint check_finite): # <<<<<<<<<<<<<<
34486 : * cdef cnp.ndarray q1, r1, u1, qnew, rnew
34487 : * cdef int j
34488 : */
34489 :
34490 18346 : static PyObject *__pyx_f_5scipy_6linalg_14_decomp_update_qr_insert_col(PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_u, int __pyx_v_k, PyObject *__pyx_v_rcond, int __pyx_v_overwrite_qru, int __pyx_v_check_finite) {
34491 18346 : PyArrayObject *__pyx_v_q1 = 0;
34492 18346 : PyArrayObject *__pyx_v_r1 = 0;
34493 18346 : PyArrayObject *__pyx_v_u1 = 0;
34494 18346 : PyArrayObject *__pyx_v_qnew = 0;
34495 18346 : PyArrayObject *__pyx_v_rnew = 0;
34496 18346 : CYTHON_UNUSED int __pyx_v_q_flags;
34497 18346 : int __pyx_v_u_flags;
34498 18346 : int __pyx_v_typecode;
34499 18346 : int __pyx_v_m;
34500 18346 : int __pyx_v_n;
34501 18346 : int __pyx_v_p;
34502 18346 : int __pyx_v_info;
34503 18346 : int __pyx_v_p_eco;
34504 18346 : int __pyx_v_p_full;
34505 18346 : void *__pyx_v_qptr;
34506 18346 : void *__pyx_v_rptr;
34507 18346 : void *__pyx_v_uptr;
34508 18346 : int __pyx_v_qs[2];
34509 18346 : int __pyx_v_rs[2];
34510 18346 : int __pyx_v_us[2];
34511 18346 : npy_intp __pyx_v_shape[2];
34512 18346 : int __pyx_v_economic;
34513 18346 : float __pyx_v_frc;
34514 18346 : double __pyx_v_drc;
34515 18346 : __pyx_t_float_complex __pyx_v_cfrc;
34516 18346 : __pyx_t_double_complex __pyx_v_cdrc;
34517 18346 : PyObject *__pyx_r = NULL;
34518 : __Pyx_RefNannyDeclarations
34519 18346 : PyObject *__pyx_t_1 = NULL;
34520 18346 : PyObject *__pyx_t_2 = NULL;
34521 18346 : PyObject *__pyx_t_3 = NULL;
34522 18346 : PyObject *__pyx_t_4 = NULL;
34523 18346 : PyObject *__pyx_t_5 = NULL;
34524 18346 : PyObject *__pyx_t_6 = NULL;
34525 18346 : PyObject *__pyx_t_7 = NULL;
34526 18346 : int __pyx_t_8;
34527 18346 : int __pyx_t_9;
34528 18346 : int __pyx_t_10;
34529 18346 : int __pyx_t_11;
34530 18346 : int __pyx_t_12;
34531 18346 : double __pyx_t_13;
34532 18346 : float __pyx_t_14;
34533 18346 : PyObject *__pyx_t_15 = NULL;
34534 18346 : unsigned int __pyx_t_16;
34535 18346 : int __pyx_lineno = 0;
34536 18346 : const char *__pyx_filename = NULL;
34537 18346 : int __pyx_clineno = 0;
34538 18346 : __Pyx_RefNannySetupContext("qr_insert_col", 1);
34539 :
34540 : /* "scipy/linalg/_decomp_update.pyx":1982
34541 : * cdef cnp.ndarray q1, r1, u1, qnew, rnew
34542 : * cdef int j
34543 : * cdef int q_flags = ARRAY_ANYORDER # <<<<<<<<<<<<<<
34544 : * cdef int u_flags = cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES
34545 : * cdef int typecode, m, n, p, info, p_eco, p_full
34546 : */
34547 18346 : __pyx_v_q_flags = 0;
34548 :
34549 : /* "scipy/linalg/_decomp_update.pyx":1983
34550 : * cdef int j
34551 : * cdef int q_flags = ARRAY_ANYORDER
34552 : * cdef int u_flags = cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES # <<<<<<<<<<<<<<
34553 : * cdef int typecode, m, n, p, info, p_eco, p_full
34554 : * cdef void* qptr
34555 : */
34556 18346 : __pyx_v_u_flags = (NPY_ARRAY_BEHAVED_NS | NPY_ARRAY_ELEMENTSTRIDES);
34557 :
34558 : /* "scipy/linalg/_decomp_update.pyx":1993
34559 : * cdef cnp.npy_intp shape[2]
34560 : * cdef bint economic
34561 : * cdef float frc = libc.float.FLT_EPSILON # <<<<<<<<<<<<<<
34562 : * cdef double drc = libc.float.DBL_EPSILON
34563 : * cdef float_complex cfrc = frc
34564 : */
34565 18346 : __pyx_v_frc = FLT_EPSILON;
34566 :
34567 : /* "scipy/linalg/_decomp_update.pyx":1994
34568 : * cdef bint economic
34569 : * cdef float frc = libc.float.FLT_EPSILON
34570 : * cdef double drc = libc.float.DBL_EPSILON # <<<<<<<<<<<<<<
34571 : * cdef float_complex cfrc = frc
34572 : * cdef double_complex cdrc = drc
34573 : */
34574 18346 : __pyx_v_drc = DBL_EPSILON;
34575 :
34576 : /* "scipy/linalg/_decomp_update.pyx":1995
34577 : * cdef float frc = libc.float.FLT_EPSILON
34578 : * cdef double drc = libc.float.DBL_EPSILON
34579 : * cdef float_complex cfrc = frc # <<<<<<<<<<<<<<
34580 : * cdef double_complex cdrc = drc
34581 : *
34582 : */
34583 18346 : __pyx_v_cfrc = __pyx_t_float_complex_from_parts(__pyx_v_frc, 0);
34584 :
34585 : /* "scipy/linalg/_decomp_update.pyx":1996
34586 : * cdef double drc = libc.float.DBL_EPSILON
34587 : * cdef float_complex cfrc = frc
34588 : * cdef double_complex cdrc = drc # <<<<<<<<<<<<<<
34589 : *
34590 : * # 1 eco q alloc, r alloc, u any
34591 : */
34592 18346 : __pyx_v_cdrc = __pyx_t_double_complex_from_parts(__pyx_v_drc, 0);
34593 :
34594 : /* "scipy/linalg/_decomp_update.pyx":2003
34595 : * # p full, q F, r alloc, u any (handled in form_qTu)
34596 : *
34597 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, True, ARRAY_ANYORDER, # <<<<<<<<<<<<<<
34598 : * True, ARRAY_ANYORDER, check_finite)
34599 : * if not overwrite_qru:
34600 : */
34601 18346 : __pyx_t_1 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(__pyx_v_Q, __pyx_v_R, 1, 0, 1, 0, __pyx_v_check_finite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2003, __pyx_L1_error)
34602 18210 : __Pyx_GOTREF(__pyx_t_1);
34603 18210 : if (likely(__pyx_t_1 != Py_None)) {
34604 18210 : PyObject* sequence = __pyx_t_1;
34605 18210 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
34606 18210 : if (unlikely(size != 6)) {
34607 0 : if (size > 6) __Pyx_RaiseTooManyValuesError(6);
34608 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
34609 0 : __PYX_ERR(0, 2003, __pyx_L1_error)
34610 : }
34611 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34612 18210 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
34613 18210 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
34614 18210 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
34615 18210 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
34616 18210 : __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
34617 18210 : __pyx_t_7 = PyTuple_GET_ITEM(sequence, 5);
34618 18210 : __Pyx_INCREF(__pyx_t_2);
34619 18210 : __Pyx_INCREF(__pyx_t_3);
34620 18210 : __Pyx_INCREF(__pyx_t_4);
34621 18210 : __Pyx_INCREF(__pyx_t_5);
34622 18210 : __Pyx_INCREF(__pyx_t_6);
34623 18210 : __Pyx_INCREF(__pyx_t_7);
34624 : #else
34625 : {
34626 : Py_ssize_t i;
34627 : PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7};
34628 : for (i=0; i < 6; i++) {
34629 : PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2003, __pyx_L1_error)
34630 : __Pyx_GOTREF(item);
34631 : *(temps[i]) = item;
34632 : }
34633 : }
34634 : #endif
34635 18210 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34636 : } else {
34637 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2003, __pyx_L1_error)
34638 : }
34639 18210 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2003, __pyx_L1_error)
34640 18210 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2003, __pyx_L1_error)
34641 18210 : __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L1_error)
34642 18210 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34643 18210 : __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L1_error)
34644 18210 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
34645 18210 : __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L1_error)
34646 18210 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
34647 18210 : __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L1_error)
34648 18210 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34649 18210 : __pyx_v_q1 = ((PyArrayObject *)__pyx_t_2);
34650 18210 : __pyx_t_2 = 0;
34651 18210 : __pyx_v_r1 = ((PyArrayObject *)__pyx_t_3);
34652 18210 : __pyx_t_3 = 0;
34653 18210 : __pyx_v_typecode = __pyx_t_8;
34654 18210 : __pyx_v_m = __pyx_t_9;
34655 18210 : __pyx_v_n = __pyx_t_10;
34656 18210 : __pyx_v_economic = __pyx_t_11;
34657 :
34658 : /* "scipy/linalg/_decomp_update.pyx":2005
34659 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, True, ARRAY_ANYORDER,
34660 : * True, ARRAY_ANYORDER, check_finite)
34661 : * if not overwrite_qru: # <<<<<<<<<<<<<<
34662 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY | cnp.NPY_ARRAY_F_CONTIGUOUS
34663 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
34664 : */
34665 18210 : __pyx_t_11 = (!__pyx_v_overwrite_qru);
34666 18210 : if (__pyx_t_11) {
34667 :
34668 : /* "scipy/linalg/_decomp_update.pyx":2006
34669 : * True, ARRAY_ANYORDER, check_finite)
34670 : * if not overwrite_qru:
34671 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY | cnp.NPY_ARRAY_F_CONTIGUOUS # <<<<<<<<<<<<<<
34672 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
34673 : *
34674 : */
34675 1020 : __pyx_v_u_flags = (__pyx_v_u_flags | (NPY_ARRAY_ENSURECOPY | NPY_ARRAY_F_CONTIGUOUS));
34676 :
34677 : /* "scipy/linalg/_decomp_update.pyx":2005
34678 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, True, ARRAY_ANYORDER,
34679 : * True, ARRAY_ANYORDER, check_finite)
34680 : * if not overwrite_qru: # <<<<<<<<<<<<<<
34681 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY | cnp.NPY_ARRAY_F_CONTIGUOUS
34682 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
34683 : */
34684 : }
34685 :
34686 : /* "scipy/linalg/_decomp_update.pyx":2007
34687 : * if not overwrite_qru:
34688 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY | cnp.NPY_ARRAY_F_CONTIGUOUS
34689 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL) # <<<<<<<<<<<<<<
34690 : *
34691 : * if cnp.PyArray_TYPE(u1) != typecode:
34692 : */
34693 18210 : __pyx_t_1 = ((PyObject *)PyArray_CheckFromAny(__pyx_v_u, NULL, 0, 0, __pyx_v_u_flags, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2007, __pyx_L1_error)
34694 18210 : __Pyx_GOTREF(__pyx_t_1);
34695 18210 : __pyx_v_u1 = ((PyArrayObject *)__pyx_t_1);
34696 18210 : __pyx_t_1 = 0;
34697 :
34698 : /* "scipy/linalg/_decomp_update.pyx":2009
34699 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
34700 : *
34701 : * if cnp.PyArray_TYPE(u1) != typecode: # <<<<<<<<<<<<<<
34702 : * raise ValueError("'u' must have the same type as Q and R")
34703 : * if not (-n <= k <= n):
34704 : */
34705 18210 : __pyx_t_11 = (PyArray_TYPE(__pyx_v_u1) != __pyx_v_typecode);
34706 18210 : if (unlikely(__pyx_t_11)) {
34707 :
34708 : /* "scipy/linalg/_decomp_update.pyx":2010
34709 : *
34710 : * if cnp.PyArray_TYPE(u1) != typecode:
34711 : * raise ValueError("'u' must have the same type as Q and R") # <<<<<<<<<<<<<<
34712 : * if not (-n <= k <= n):
34713 : * raise ValueError("'k' is out of bounds")
34714 : */
34715 51 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2010, __pyx_L1_error)
34716 51 : __Pyx_GOTREF(__pyx_t_1);
34717 51 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
34718 51 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34719 51 : __PYX_ERR(0, 2010, __pyx_L1_error)
34720 :
34721 : /* "scipy/linalg/_decomp_update.pyx":2009
34722 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, u_flags, NULL)
34723 : *
34724 : * if cnp.PyArray_TYPE(u1) != typecode: # <<<<<<<<<<<<<<
34725 : * raise ValueError("'u' must have the same type as Q and R")
34726 : * if not (-n <= k <= n):
34727 : */
34728 : }
34729 :
34730 : /* "scipy/linalg/_decomp_update.pyx":2011
34731 : * if cnp.PyArray_TYPE(u1) != typecode:
34732 : * raise ValueError("'u' must have the same type as Q and R")
34733 : * if not (-n <= k <= n): # <<<<<<<<<<<<<<
34734 : * raise ValueError("'k' is out of bounds")
34735 : * if k < 0:
34736 : */
34737 18159 : __pyx_t_11 = ((-__pyx_v_n) <= __pyx_v_k);
34738 18159 : if (__pyx_t_11) {
34739 18159 : __pyx_t_11 = (__pyx_v_k <= __pyx_v_n);
34740 : }
34741 18159 : __pyx_t_12 = (!__pyx_t_11);
34742 18159 : if (unlikely(__pyx_t_12)) {
34743 :
34744 : /* "scipy/linalg/_decomp_update.pyx":2012
34745 : * raise ValueError("'u' must have the same type as Q and R")
34746 : * if not (-n <= k <= n):
34747 : * raise ValueError("'k' is out of bounds") # <<<<<<<<<<<<<<
34748 : * if k < 0:
34749 : * k += n
34750 : */
34751 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __pyx_L1_error)
34752 0 : __Pyx_GOTREF(__pyx_t_1);
34753 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
34754 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34755 0 : __PYX_ERR(0, 2012, __pyx_L1_error)
34756 :
34757 : /* "scipy/linalg/_decomp_update.pyx":2011
34758 : * if cnp.PyArray_TYPE(u1) != typecode:
34759 : * raise ValueError("'u' must have the same type as Q and R")
34760 : * if not (-n <= k <= n): # <<<<<<<<<<<<<<
34761 : * raise ValueError("'k' is out of bounds")
34762 : * if k < 0:
34763 : */
34764 : }
34765 :
34766 : /* "scipy/linalg/_decomp_update.pyx":2013
34767 : * if not (-n <= k <= n):
34768 : * raise ValueError("'k' is out of bounds")
34769 : * if k < 0: # <<<<<<<<<<<<<<
34770 : * k += n
34771 : *
34772 : */
34773 18159 : __pyx_t_12 = (__pyx_v_k < 0);
34774 18159 : if (__pyx_t_12) {
34775 :
34776 : /* "scipy/linalg/_decomp_update.pyx":2014
34777 : * raise ValueError("'k' is out of bounds")
34778 : * if k < 0:
34779 : * k += n # <<<<<<<<<<<<<<
34780 : *
34781 : * if u1.ndim == 2:
34782 : */
34783 0 : __pyx_v_k = (__pyx_v_k + __pyx_v_n);
34784 :
34785 : /* "scipy/linalg/_decomp_update.pyx":2013
34786 : * if not (-n <= k <= n):
34787 : * raise ValueError("'k' is out of bounds")
34788 : * if k < 0: # <<<<<<<<<<<<<<
34789 : * k += n
34790 : *
34791 : */
34792 : }
34793 :
34794 : /* "scipy/linalg/_decomp_update.pyx":2016
34795 : * k += n
34796 : *
34797 : * if u1.ndim == 2: # <<<<<<<<<<<<<<
34798 : * p = u1.shape[1]
34799 : * if u1.shape[0] != m:
34800 : */
34801 18159 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) == 2);
34802 18159 : if (__pyx_t_12) {
34803 :
34804 : /* "scipy/linalg/_decomp_update.pyx":2017
34805 : *
34806 : * if u1.ndim == 2:
34807 : * p = u1.shape[1] # <<<<<<<<<<<<<<
34808 : * if u1.shape[0] != m:
34809 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34810 : */
34811 736 : __pyx_v_p = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[1]);
34812 :
34813 : /* "scipy/linalg/_decomp_update.pyx":2018
34814 : * if u1.ndim == 2:
34815 : * p = u1.shape[1]
34816 : * if u1.shape[0] != m: # <<<<<<<<<<<<<<
34817 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34818 : * "inserting columns. Found %s." %
34819 : */
34820 736 : __pyx_t_12 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[0]) != __pyx_v_m);
34821 736 : if (unlikely(__pyx_t_12)) {
34822 :
34823 : /* "scipy/linalg/_decomp_update.pyx":2021
34824 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34825 : * "inserting columns. Found %s." %
34826 : * str(getattr(u1, 'shape'))) # <<<<<<<<<<<<<<
34827 : * elif u1.ndim == 1:
34828 : * p = 1
34829 : */
34830 4 : __pyx_t_1 = __Pyx_GetAttr(((PyObject *)__pyx_v_u1), __pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error)
34831 4 : __Pyx_GOTREF(__pyx_t_1);
34832 4 : __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2021, __pyx_L1_error)
34833 4 : __Pyx_GOTREF(__pyx_t_7);
34834 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34835 :
34836 : /* "scipy/linalg/_decomp_update.pyx":2020
34837 : * if u1.shape[0] != m:
34838 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34839 : * "inserting columns. Found %s." % # <<<<<<<<<<<<<<
34840 : * str(getattr(u1, 'shape')))
34841 : * elif u1.ndim == 1:
34842 : */
34843 4 : __pyx_t_1 = PyUnicode_Format(__pyx_kp_u_u_should_be_either_M_or_M_p_whe, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2020, __pyx_L1_error)
34844 4 : __Pyx_GOTREF(__pyx_t_1);
34845 4 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34846 :
34847 : /* "scipy/linalg/_decomp_update.pyx":2019
34848 : * p = u1.shape[1]
34849 : * if u1.shape[0] != m:
34850 : * raise ValueError("'u' should be either (M,) or (M,p) when " # <<<<<<<<<<<<<<
34851 : * "inserting columns. Found %s." %
34852 : * str(getattr(u1, 'shape')))
34853 : */
34854 4 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2019, __pyx_L1_error)
34855 4 : __Pyx_GOTREF(__pyx_t_7);
34856 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34857 4 : __Pyx_Raise(__pyx_t_7, 0, 0, 0);
34858 4 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34859 4 : __PYX_ERR(0, 2019, __pyx_L1_error)
34860 :
34861 : /* "scipy/linalg/_decomp_update.pyx":2018
34862 : * if u1.ndim == 2:
34863 : * p = u1.shape[1]
34864 : * if u1.shape[0] != m: # <<<<<<<<<<<<<<
34865 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34866 : * "inserting columns. Found %s." %
34867 : */
34868 : }
34869 :
34870 : /* "scipy/linalg/_decomp_update.pyx":2016
34871 : * k += n
34872 : *
34873 : * if u1.ndim == 2: # <<<<<<<<<<<<<<
34874 : * p = u1.shape[1]
34875 : * if u1.shape[0] != m:
34876 : */
34877 732 : goto __pyx_L7;
34878 : }
34879 :
34880 : /* "scipy/linalg/_decomp_update.pyx":2022
34881 : * "inserting columns. Found %s." %
34882 : * str(getattr(u1, 'shape')))
34883 : * elif u1.ndim == 1: # <<<<<<<<<<<<<<
34884 : * p = 1
34885 : * if u1.shape[0] != m:
34886 : */
34887 17423 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) == 1);
34888 17423 : if (likely(__pyx_t_12)) {
34889 :
34890 : /* "scipy/linalg/_decomp_update.pyx":2023
34891 : * str(getattr(u1, 'shape')))
34892 : * elif u1.ndim == 1:
34893 : * p = 1 # <<<<<<<<<<<<<<
34894 : * if u1.shape[0] != m:
34895 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34896 : */
34897 17419 : __pyx_v_p = 1;
34898 :
34899 : /* "scipy/linalg/_decomp_update.pyx":2024
34900 : * elif u1.ndim == 1:
34901 : * p = 1
34902 : * if u1.shape[0] != m: # <<<<<<<<<<<<<<
34903 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34904 : * "inserting columns. Found %s." %
34905 : */
34906 17419 : __pyx_t_12 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[0]) != __pyx_v_m);
34907 17419 : if (unlikely(__pyx_t_12)) {
34908 :
34909 : /* "scipy/linalg/_decomp_update.pyx":2027
34910 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34911 : * "inserting columns. Found %s." %
34912 : * str(getattr(u1, 'shape'))) # <<<<<<<<<<<<<<
34913 : * else:
34914 : * raise ValueError("'u' must be either 1- or 2-D")
34915 : */
34916 9 : __pyx_t_7 = __Pyx_GetAttr(((PyObject *)__pyx_v_u1), __pyx_n_u_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2027, __pyx_L1_error)
34917 9 : __Pyx_GOTREF(__pyx_t_7);
34918 9 : __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2027, __pyx_L1_error)
34919 9 : __Pyx_GOTREF(__pyx_t_1);
34920 9 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34921 :
34922 : /* "scipy/linalg/_decomp_update.pyx":2026
34923 : * if u1.shape[0] != m:
34924 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34925 : * "inserting columns. Found %s." % # <<<<<<<<<<<<<<
34926 : * str(getattr(u1, 'shape')))
34927 : * else:
34928 : */
34929 9 : __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_u_should_be_either_M_or_M_p_whe, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2026, __pyx_L1_error)
34930 9 : __Pyx_GOTREF(__pyx_t_7);
34931 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34932 :
34933 : /* "scipy/linalg/_decomp_update.pyx":2025
34934 : * p = 1
34935 : * if u1.shape[0] != m:
34936 : * raise ValueError("'u' should be either (M,) or (M,p) when " # <<<<<<<<<<<<<<
34937 : * "inserting columns. Found %s." %
34938 : * str(getattr(u1, 'shape')))
34939 : */
34940 9 : __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2025, __pyx_L1_error)
34941 9 : __Pyx_GOTREF(__pyx_t_1);
34942 9 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34943 9 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
34944 9 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34945 9 : __PYX_ERR(0, 2025, __pyx_L1_error)
34946 :
34947 : /* "scipy/linalg/_decomp_update.pyx":2024
34948 : * elif u1.ndim == 1:
34949 : * p = 1
34950 : * if u1.shape[0] != m: # <<<<<<<<<<<<<<
34951 : * raise ValueError("'u' should be either (M,) or (M,p) when "
34952 : * "inserting columns. Found %s." %
34953 : */
34954 : }
34955 :
34956 : /* "scipy/linalg/_decomp_update.pyx":2022
34957 : * "inserting columns. Found %s." %
34958 : * str(getattr(u1, 'shape')))
34959 : * elif u1.ndim == 1: # <<<<<<<<<<<<<<
34960 : * p = 1
34961 : * if u1.shape[0] != m:
34962 : */
34963 17410 : goto __pyx_L7;
34964 : }
34965 :
34966 : /* "scipy/linalg/_decomp_update.pyx":2029
34967 : * str(getattr(u1, 'shape')))
34968 : * else:
34969 : * raise ValueError("'u' must be either 1- or 2-D") # <<<<<<<<<<<<<<
34970 : *
34971 : * if rcond is not None and economic:
34972 : */
34973 : /*else*/ {
34974 4 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2029, __pyx_L1_error)
34975 4 : __Pyx_GOTREF(__pyx_t_1);
34976 4 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
34977 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34978 4 : __PYX_ERR(0, 2029, __pyx_L1_error)
34979 : }
34980 18142 : __pyx_L7:;
34981 :
34982 : /* "scipy/linalg/_decomp_update.pyx":2031
34983 : * raise ValueError("'u' must be either 1- or 2-D")
34984 : *
34985 : * if rcond is not None and economic: # <<<<<<<<<<<<<<
34986 : * if typecode == cnp.NPY_DOUBLE or typecode == cnp.NPY_CDOUBLE:
34987 : * drc = rcond
34988 : */
34989 18142 : __pyx_t_11 = (__pyx_v_rcond != Py_None);
34990 18142 : if (__pyx_t_11) {
34991 : } else {
34992 18142 : __pyx_t_12 = __pyx_t_11;
34993 18142 : goto __pyx_L11_bool_binop_done;
34994 : }
34995 : __pyx_t_12 = __pyx_v_economic;
34996 18142 : __pyx_L11_bool_binop_done:;
34997 18142 : if (__pyx_t_12) {
34998 :
34999 : /* "scipy/linalg/_decomp_update.pyx":2032
35000 : *
35001 : * if rcond is not None and economic:
35002 : * if typecode == cnp.NPY_DOUBLE or typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
35003 : * drc = rcond
35004 : * else:
35005 : */
35006 0 : switch (__pyx_v_typecode) {
35007 : case NPY_DOUBLE:
35008 : case NPY_CDOUBLE:
35009 :
35010 : /* "scipy/linalg/_decomp_update.pyx":2033
35011 : * if rcond is not None and economic:
35012 : * if typecode == cnp.NPY_DOUBLE or typecode == cnp.NPY_CDOUBLE:
35013 : * drc = rcond # <<<<<<<<<<<<<<
35014 : * else:
35015 : * frc = rcond
35016 : */
35017 0 : __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_rcond); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2033, __pyx_L1_error)
35018 0 : __pyx_v_drc = __pyx_t_13;
35019 :
35020 : /* "scipy/linalg/_decomp_update.pyx":2032
35021 : *
35022 : * if rcond is not None and economic:
35023 : * if typecode == cnp.NPY_DOUBLE or typecode == cnp.NPY_CDOUBLE: # <<<<<<<<<<<<<<
35024 : * drc = rcond
35025 : * else:
35026 : */
35027 0 : break;
35028 : default:
35029 :
35030 : /* "scipy/linalg/_decomp_update.pyx":2035
35031 : * drc = rcond
35032 : * else:
35033 : * frc = rcond # <<<<<<<<<<<<<<
35034 : * elif rcond is not None:
35035 : * raise ValueError("'rcond' is not used when updating full, (M,M) (M,N) "
35036 : */
35037 0 : __pyx_t_14 = __pyx_PyFloat_AsFloat(__pyx_v_rcond); if (unlikely((__pyx_t_14 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2035, __pyx_L1_error)
35038 0 : __pyx_v_frc = __pyx_t_14;
35039 0 : break;
35040 : }
35041 :
35042 : /* "scipy/linalg/_decomp_update.pyx":2031
35043 : * raise ValueError("'u' must be either 1- or 2-D")
35044 : *
35045 : * if rcond is not None and economic: # <<<<<<<<<<<<<<
35046 : * if typecode == cnp.NPY_DOUBLE or typecode == cnp.NPY_CDOUBLE:
35047 : * drc = rcond
35048 : */
35049 0 : goto __pyx_L10;
35050 : }
35051 :
35052 : /* "scipy/linalg/_decomp_update.pyx":2036
35053 : * else:
35054 : * frc = rcond
35055 : * elif rcond is not None: # <<<<<<<<<<<<<<
35056 : * raise ValueError("'rcond' is not used when updating full, (M,M) (M,N) "
35057 : * "decompositions and must be None.")
35058 : */
35059 18142 : __pyx_t_12 = (__pyx_v_rcond != Py_None);
35060 18142 : if (unlikely(__pyx_t_12)) {
35061 :
35062 : /* "scipy/linalg/_decomp_update.pyx":2037
35063 : * frc = rcond
35064 : * elif rcond is not None:
35065 : * raise ValueError("'rcond' is not used when updating full, (M,M) (M,N) " # <<<<<<<<<<<<<<
35066 : * "decompositions and must be None.")
35067 : *
35068 : */
35069 0 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2037, __pyx_L1_error)
35070 0 : __Pyx_GOTREF(__pyx_t_1);
35071 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
35072 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35073 0 : __PYX_ERR(0, 2037, __pyx_L1_error)
35074 :
35075 : /* "scipy/linalg/_decomp_update.pyx":2036
35076 : * else:
35077 : * frc = rcond
35078 : * elif rcond is not None: # <<<<<<<<<<<<<<
35079 : * raise ValueError("'rcond' is not used when updating full, (M,M) (M,N) "
35080 : * "decompositions and must be None.")
35081 : */
35082 : }
35083 18142 : __pyx_L10:;
35084 :
35085 : /* "scipy/linalg/_decomp_update.pyx":2042
35086 : * # special case 1xN
35087 : * # if m == 1, Q is always 1x1 and abs(Q[0,0]) == 1.0
35088 : * if m == 1: # <<<<<<<<<<<<<<
35089 : * rnew = np.insert(r1, np.full(p, k, np.intp), q1.conjugate()*u1, 1)
35090 : * return q1.copy(), rnew
35091 : */
35092 18142 : __pyx_t_12 = (__pyx_v_m == 1);
35093 18142 : if (__pyx_t_12) {
35094 :
35095 : /* "scipy/linalg/_decomp_update.pyx":2043
35096 : * # if m == 1, Q is always 1x1 and abs(Q[0,0]) == 1.0
35097 : * if m == 1:
35098 : * rnew = np.insert(r1, np.full(p, k, np.intp), q1.conjugate()*u1, 1) # <<<<<<<<<<<<<<
35099 : * return q1.copy(), rnew
35100 : *
35101 : */
35102 88 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2043, __pyx_L1_error)
35103 88 : __Pyx_GOTREF(__pyx_t_7);
35104 88 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_insert); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2043, __pyx_L1_error)
35105 88 : __Pyx_GOTREF(__pyx_t_6);
35106 88 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
35107 88 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2043, __pyx_L1_error)
35108 88 : __Pyx_GOTREF(__pyx_t_5);
35109 88 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_full); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2043, __pyx_L1_error)
35110 88 : __Pyx_GOTREF(__pyx_t_4);
35111 88 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35112 88 : __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2043, __pyx_L1_error)
35113 88 : __Pyx_GOTREF(__pyx_t_5);
35114 88 : __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2043, __pyx_L1_error)
35115 88 : __Pyx_GOTREF(__pyx_t_3);
35116 88 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2043, __pyx_L1_error)
35117 88 : __Pyx_GOTREF(__pyx_t_2);
35118 88 : __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2043, __pyx_L1_error)
35119 88 : __Pyx_GOTREF(__pyx_t_15);
35120 88 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
35121 88 : __pyx_t_2 = NULL;
35122 88 : __pyx_t_16 = 0;
35123 : #if CYTHON_UNPACK_METHODS
35124 88 : if (unlikely(PyMethod_Check(__pyx_t_4))) {
35125 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
35126 0 : if (likely(__pyx_t_2)) {
35127 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
35128 0 : __Pyx_INCREF(__pyx_t_2);
35129 0 : __Pyx_INCREF(function);
35130 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
35131 : __pyx_t_16 = 1;
35132 : }
35133 : }
35134 : #endif
35135 : {
35136 88 : PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_5, __pyx_t_3, __pyx_t_15};
35137 88 : __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_16, 3+__pyx_t_16);
35138 88 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
35139 88 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35140 88 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35141 88 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
35142 88 : if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2043, __pyx_L1_error)
35143 88 : __Pyx_GOTREF(__pyx_t_7);
35144 88 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35145 : }
35146 88 : __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_q1), __pyx_n_s_conjugate); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2043, __pyx_L1_error)
35147 88 : __Pyx_GOTREF(__pyx_t_15);
35148 88 : __pyx_t_3 = NULL;
35149 88 : __pyx_t_16 = 0;
35150 : #if CYTHON_UNPACK_METHODS
35151 88 : if (likely(PyMethod_Check(__pyx_t_15))) {
35152 0 : __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15);
35153 0 : if (likely(__pyx_t_3)) {
35154 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
35155 0 : __Pyx_INCREF(__pyx_t_3);
35156 0 : __Pyx_INCREF(function);
35157 0 : __Pyx_DECREF_SET(__pyx_t_15, function);
35158 : __pyx_t_16 = 1;
35159 : }
35160 : }
35161 : #endif
35162 : {
35163 88 : PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
35164 88 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16);
35165 88 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
35166 88 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2043, __pyx_L1_error)
35167 88 : __Pyx_GOTREF(__pyx_t_4);
35168 88 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
35169 : }
35170 88 : __pyx_t_15 = PyNumber_Multiply(__pyx_t_4, ((PyObject *)__pyx_v_u1)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2043, __pyx_L1_error)
35171 88 : __Pyx_GOTREF(__pyx_t_15);
35172 88 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35173 88 : __pyx_t_4 = NULL;
35174 88 : __pyx_t_16 = 0;
35175 : #if CYTHON_UNPACK_METHODS
35176 88 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
35177 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
35178 0 : if (likely(__pyx_t_4)) {
35179 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
35180 0 : __Pyx_INCREF(__pyx_t_4);
35181 0 : __Pyx_INCREF(function);
35182 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
35183 : __pyx_t_16 = 1;
35184 : }
35185 : }
35186 : #endif
35187 : {
35188 88 : PyObject *__pyx_callargs[5] = {__pyx_t_4, ((PyObject *)__pyx_v_r1), __pyx_t_7, __pyx_t_15, __pyx_int_1};
35189 88 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_16, 4+__pyx_t_16);
35190 88 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
35191 88 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
35192 88 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
35193 88 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error)
35194 88 : __Pyx_GOTREF(__pyx_t_1);
35195 88 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35196 : }
35197 88 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2043, __pyx_L1_error)
35198 88 : __pyx_v_rnew = ((PyArrayObject *)__pyx_t_1);
35199 88 : __pyx_t_1 = 0;
35200 :
35201 : /* "scipy/linalg/_decomp_update.pyx":2044
35202 : * if m == 1:
35203 : * rnew = np.insert(r1, np.full(p, k, np.intp), q1.conjugate()*u1, 1)
35204 : * return q1.copy(), rnew # <<<<<<<<<<<<<<
35205 : *
35206 : * if economic:
35207 : */
35208 88 : __Pyx_XDECREF(__pyx_r);
35209 88 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_q1), __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2044, __pyx_L1_error)
35210 88 : __Pyx_GOTREF(__pyx_t_6);
35211 88 : __pyx_t_15 = NULL;
35212 88 : __pyx_t_16 = 0;
35213 : #if CYTHON_UNPACK_METHODS
35214 88 : if (likely(PyMethod_Check(__pyx_t_6))) {
35215 0 : __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6);
35216 0 : if (likely(__pyx_t_15)) {
35217 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
35218 0 : __Pyx_INCREF(__pyx_t_15);
35219 0 : __Pyx_INCREF(function);
35220 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
35221 : __pyx_t_16 = 1;
35222 : }
35223 : }
35224 : #endif
35225 : {
35226 88 : PyObject *__pyx_callargs[2] = {__pyx_t_15, NULL};
35227 88 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16);
35228 88 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
35229 88 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error)
35230 88 : __Pyx_GOTREF(__pyx_t_1);
35231 88 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35232 : }
35233 88 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2044, __pyx_L1_error)
35234 88 : __Pyx_GOTREF(__pyx_t_6);
35235 88 : __Pyx_GIVEREF(__pyx_t_1);
35236 88 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error);
35237 88 : __Pyx_INCREF((PyObject *)__pyx_v_rnew);
35238 88 : __Pyx_GIVEREF((PyObject *)__pyx_v_rnew);
35239 88 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_rnew))) __PYX_ERR(0, 2044, __pyx_L1_error);
35240 88 : __pyx_t_1 = 0;
35241 88 : __pyx_r = __pyx_t_6;
35242 88 : __pyx_t_6 = 0;
35243 88 : goto __pyx_L0;
35244 :
35245 : /* "scipy/linalg/_decomp_update.pyx":2042
35246 : * # special case 1xN
35247 : * # if m == 1, Q is always 1x1 and abs(Q[0,0]) == 1.0
35248 : * if m == 1: # <<<<<<<<<<<<<<
35249 : * rnew = np.insert(r1, np.full(p, k, np.intp), q1.conjugate()*u1, 1)
35250 : * return q1.copy(), rnew
35251 : */
35252 : }
35253 :
35254 : /* "scipy/linalg/_decomp_update.pyx":2046
35255 : * return q1.copy(), rnew
35256 : *
35257 : * if economic: # <<<<<<<<<<<<<<
35258 : * if n+p <= m:
35259 : * p_eco = p
35260 : */
35261 18054 : if (__pyx_v_economic) {
35262 :
35263 : /* "scipy/linalg/_decomp_update.pyx":2047
35264 : *
35265 : * if economic:
35266 : * if n+p <= m: # <<<<<<<<<<<<<<
35267 : * p_eco = p
35268 : * p_full = 0
35269 : */
35270 148 : __pyx_t_12 = ((__pyx_v_n + __pyx_v_p) <= __pyx_v_m);
35271 148 : if (__pyx_t_12) {
35272 :
35273 : /* "scipy/linalg/_decomp_update.pyx":2048
35274 : * if economic:
35275 : * if n+p <= m:
35276 : * p_eco = p # <<<<<<<<<<<<<<
35277 : * p_full = 0
35278 : * else:
35279 : */
35280 116 : __pyx_v_p_eco = __pyx_v_p;
35281 :
35282 : /* "scipy/linalg/_decomp_update.pyx":2049
35283 : * if n+p <= m:
35284 : * p_eco = p
35285 : * p_full = 0 # <<<<<<<<<<<<<<
35286 : * else:
35287 : * p_eco = m-n
35288 : */
35289 116 : __pyx_v_p_full = 0;
35290 :
35291 : /* "scipy/linalg/_decomp_update.pyx":2047
35292 : *
35293 : * if economic:
35294 : * if n+p <= m: # <<<<<<<<<<<<<<
35295 : * p_eco = p
35296 : * p_full = 0
35297 : */
35298 116 : goto __pyx_L15;
35299 : }
35300 :
35301 : /* "scipy/linalg/_decomp_update.pyx":2051
35302 : * p_full = 0
35303 : * else:
35304 : * p_eco = m-n # <<<<<<<<<<<<<<
35305 : * p_full = p - p_eco
35306 : * if not cnp.PyArray_CHKFLAGS(u1, cnp.NPY_ARRAY_F_CONTIGUOUS):
35307 : */
35308 : /*else*/ {
35309 32 : __pyx_v_p_eco = (__pyx_v_m - __pyx_v_n);
35310 :
35311 : /* "scipy/linalg/_decomp_update.pyx":2052
35312 : * else:
35313 : * p_eco = m-n
35314 : * p_full = p - p_eco # <<<<<<<<<<<<<<
35315 : * if not cnp.PyArray_CHKFLAGS(u1, cnp.NPY_ARRAY_F_CONTIGUOUS):
35316 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35317 : */
35318 32 : __pyx_v_p_full = (__pyx_v_p - __pyx_v_p_eco);
35319 :
35320 : /* "scipy/linalg/_decomp_update.pyx":2053
35321 : * p_eco = m-n
35322 : * p_full = p - p_eco
35323 : * if not cnp.PyArray_CHKFLAGS(u1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
35324 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35325 : * shape[0] = m
35326 : */
35327 32 : __pyx_t_12 = (!PyArray_CHKFLAGS(__pyx_v_u1, NPY_ARRAY_F_CONTIGUOUS));
35328 32 : if (__pyx_t_12) {
35329 :
35330 : /* "scipy/linalg/_decomp_update.pyx":2054
35331 : * p_full = p - p_eco
35332 : * if not cnp.PyArray_CHKFLAGS(u1, cnp.NPY_ARRAY_F_CONTIGUOUS):
35333 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
35334 : * shape[0] = m
35335 : * shape[1] = n+p_eco
35336 : */
35337 0 : __pyx_t_6 = ((PyObject *)PyArray_FromArray(__pyx_v_u1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2054, __pyx_L1_error)
35338 0 : __Pyx_GOTREF(__pyx_t_6);
35339 0 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_6));
35340 148 : __pyx_t_6 = 0;
35341 :
35342 : /* "scipy/linalg/_decomp_update.pyx":2053
35343 : * p_eco = m-n
35344 : * p_full = p - p_eco
35345 : * if not cnp.PyArray_CHKFLAGS(u1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
35346 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35347 : * shape[0] = m
35348 : */
35349 : }
35350 : }
35351 32 : __pyx_L15:;
35352 :
35353 : /* "scipy/linalg/_decomp_update.pyx":2055
35354 : * if not cnp.PyArray_CHKFLAGS(u1, cnp.NPY_ARRAY_F_CONTIGUOUS):
35355 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35356 : * shape[0] = m # <<<<<<<<<<<<<<
35357 : * shape[1] = n+p_eco
35358 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35359 : */
35360 148 : (__pyx_v_shape[0]) = __pyx_v_m;
35361 :
35362 : /* "scipy/linalg/_decomp_update.pyx":2056
35363 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35364 : * shape[0] = m
35365 : * shape[1] = n+p_eco # <<<<<<<<<<<<<<
35366 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35367 : * qnew[:,:-p_eco] = q1
35368 : */
35369 148 : (__pyx_v_shape[1]) = (__pyx_v_n + __pyx_v_p_eco);
35370 :
35371 : /* "scipy/linalg/_decomp_update.pyx":2057
35372 : * shape[0] = m
35373 : * shape[1] = n+p_eco
35374 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1) # <<<<<<<<<<<<<<
35375 : * qnew[:,:-p_eco] = q1
35376 : *
35377 : */
35378 148 : __pyx_t_6 = PyArray_ZEROS(2, __pyx_v_shape, __pyx_v_typecode, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2057, __pyx_L1_error)
35379 148 : __Pyx_GOTREF(__pyx_t_6);
35380 148 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2057, __pyx_L1_error)
35381 148 : __pyx_v_qnew = ((PyArrayObject *)__pyx_t_6);
35382 148 : __pyx_t_6 = 0;
35383 :
35384 : /* "scipy/linalg/_decomp_update.pyx":2058
35385 : * shape[1] = n+p_eco
35386 : * qnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35387 : * qnew[:,:-p_eco] = q1 # <<<<<<<<<<<<<<
35388 : *
35389 : * shape[0] = n+p_eco
35390 : */
35391 148 : __pyx_t_6 = __Pyx_PyInt_From_int((-__pyx_v_p_eco)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2058, __pyx_L1_error)
35392 148 : __Pyx_GOTREF(__pyx_t_6);
35393 148 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2058, __pyx_L1_error)
35394 148 : __Pyx_GOTREF(__pyx_t_1);
35395 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35396 148 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2058, __pyx_L1_error)
35397 148 : __Pyx_GOTREF(__pyx_t_6);
35398 148 : __Pyx_INCREF(__pyx_slice__16);
35399 148 : __Pyx_GIVEREF(__pyx_slice__16);
35400 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__16)) __PYX_ERR(0, 2058, __pyx_L1_error);
35401 148 : __Pyx_GIVEREF(__pyx_t_1);
35402 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(0, 2058, __pyx_L1_error);
35403 148 : __pyx_t_1 = 0;
35404 148 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_qnew), __pyx_t_6, ((PyObject *)__pyx_v_q1)) < 0))) __PYX_ERR(0, 2058, __pyx_L1_error)
35405 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35406 :
35407 : /* "scipy/linalg/_decomp_update.pyx":2060
35408 : * qnew[:,:-p_eco] = q1
35409 : *
35410 : * shape[0] = n+p_eco # <<<<<<<<<<<<<<
35411 : * shape[1] = n+p
35412 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35413 : */
35414 148 : (__pyx_v_shape[0]) = (__pyx_v_n + __pyx_v_p_eco);
35415 :
35416 : /* "scipy/linalg/_decomp_update.pyx":2061
35417 : *
35418 : * shape[0] = n+p_eco
35419 : * shape[1] = n+p # <<<<<<<<<<<<<<
35420 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35421 : * rnew[:n,:k] = r1[:,:k]
35422 : */
35423 148 : (__pyx_v_shape[1]) = (__pyx_v_n + __pyx_v_p);
35424 :
35425 : /* "scipy/linalg/_decomp_update.pyx":2062
35426 : * shape[0] = n+p_eco
35427 : * shape[1] = n+p
35428 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1) # <<<<<<<<<<<<<<
35429 : * rnew[:n,:k] = r1[:,:k]
35430 : * rnew[:n,k+p:] = r1[:,k:]
35431 : */
35432 148 : __pyx_t_6 = PyArray_ZEROS(2, __pyx_v_shape, __pyx_v_typecode, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2062, __pyx_L1_error)
35433 148 : __Pyx_GOTREF(__pyx_t_6);
35434 148 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2062, __pyx_L1_error)
35435 148 : __pyx_v_rnew = ((PyArrayObject *)__pyx_t_6);
35436 148 : __pyx_t_6 = 0;
35437 :
35438 : /* "scipy/linalg/_decomp_update.pyx":2063
35439 : * shape[1] = n+p
35440 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35441 : * rnew[:n,:k] = r1[:,:k] # <<<<<<<<<<<<<<
35442 : * rnew[:n,k+p:] = r1[:,k:]
35443 : * u1 = validate_array(u1, check_finite)
35444 : */
35445 148 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2063, __pyx_L1_error)
35446 148 : __Pyx_GOTREF(__pyx_t_6);
35447 148 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error)
35448 148 : __Pyx_GOTREF(__pyx_t_1);
35449 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35450 148 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2063, __pyx_L1_error)
35451 148 : __Pyx_GOTREF(__pyx_t_6);
35452 148 : __Pyx_INCREF(__pyx_slice__16);
35453 148 : __Pyx_GIVEREF(__pyx_slice__16);
35454 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__16)) __PYX_ERR(0, 2063, __pyx_L1_error);
35455 148 : __Pyx_GIVEREF(__pyx_t_1);
35456 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error);
35457 148 : __pyx_t_1 = 0;
35458 148 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error)
35459 148 : __Pyx_GOTREF(__pyx_t_1);
35460 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35461 148 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2063, __pyx_L1_error)
35462 148 : __Pyx_GOTREF(__pyx_t_6);
35463 148 : __pyx_t_15 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2063, __pyx_L1_error)
35464 148 : __Pyx_GOTREF(__pyx_t_15);
35465 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35466 148 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2063, __pyx_L1_error)
35467 148 : __Pyx_GOTREF(__pyx_t_6);
35468 148 : __pyx_t_7 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2063, __pyx_L1_error)
35469 148 : __Pyx_GOTREF(__pyx_t_7);
35470 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35471 148 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2063, __pyx_L1_error)
35472 148 : __Pyx_GOTREF(__pyx_t_6);
35473 148 : __Pyx_GIVEREF(__pyx_t_15);
35474 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_15)) __PYX_ERR(0, 2063, __pyx_L1_error);
35475 148 : __Pyx_GIVEREF(__pyx_t_7);
35476 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 2063, __pyx_L1_error);
35477 148 : __pyx_t_15 = 0;
35478 148 : __pyx_t_7 = 0;
35479 148 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rnew), __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 2063, __pyx_L1_error)
35480 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35481 148 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35482 :
35483 : /* "scipy/linalg/_decomp_update.pyx":2064
35484 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35485 : * rnew[:n,:k] = r1[:,:k]
35486 : * rnew[:n,k+p:] = r1[:,k:] # <<<<<<<<<<<<<<
35487 : * u1 = validate_array(u1, check_finite)
35488 : * qptr = extract(qnew, qs)
35489 : */
35490 148 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
35491 148 : __Pyx_GOTREF(__pyx_t_1);
35492 148 : __pyx_t_6 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2064, __pyx_L1_error)
35493 148 : __Pyx_GOTREF(__pyx_t_6);
35494 148 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35495 148 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
35496 148 : __Pyx_GOTREF(__pyx_t_1);
35497 148 : __Pyx_INCREF(__pyx_slice__16);
35498 148 : __Pyx_GIVEREF(__pyx_slice__16);
35499 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__16)) __PYX_ERR(0, 2064, __pyx_L1_error);
35500 148 : __Pyx_GIVEREF(__pyx_t_6);
35501 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2064, __pyx_L1_error);
35502 148 : __pyx_t_6 = 0;
35503 148 : __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2064, __pyx_L1_error)
35504 148 : __Pyx_GOTREF(__pyx_t_6);
35505 148 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35506 148 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
35507 148 : __Pyx_GOTREF(__pyx_t_1);
35508 148 : __pyx_t_7 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2064, __pyx_L1_error)
35509 148 : __Pyx_GOTREF(__pyx_t_7);
35510 148 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35511 148 : __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_k + __pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
35512 148 : __Pyx_GOTREF(__pyx_t_1);
35513 148 : __pyx_t_15 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2064, __pyx_L1_error)
35514 148 : __Pyx_GOTREF(__pyx_t_15);
35515 148 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35516 148 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
35517 148 : __Pyx_GOTREF(__pyx_t_1);
35518 148 : __Pyx_GIVEREF(__pyx_t_7);
35519 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 2064, __pyx_L1_error);
35520 148 : __Pyx_GIVEREF(__pyx_t_15);
35521 148 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_15)) __PYX_ERR(0, 2064, __pyx_L1_error);
35522 148 : __pyx_t_7 = 0;
35523 148 : __pyx_t_15 = 0;
35524 148 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rnew), __pyx_t_1, __pyx_t_6) < 0))) __PYX_ERR(0, 2064, __pyx_L1_error)
35525 148 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35526 148 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35527 :
35528 : /* "scipy/linalg/_decomp_update.pyx":2065
35529 : * rnew[:n,:k] = r1[:,:k]
35530 : * rnew[:n,k+p:] = r1[:,k:]
35531 : * u1 = validate_array(u1, check_finite) # <<<<<<<<<<<<<<
35532 : * qptr = extract(qnew, qs)
35533 : * rptr = extract(rnew, rs)
35534 : */
35535 148 : __pyx_t_6 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_u1, __pyx_v_check_finite); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2065, __pyx_L1_error)
35536 148 : __Pyx_GOTREF(__pyx_t_6);
35537 148 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2065, __pyx_L1_error)
35538 148 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_6));
35539 148 : __pyx_t_6 = 0;
35540 :
35541 : /* "scipy/linalg/_decomp_update.pyx":2066
35542 : * rnew[:n,k+p:] = r1[:,k:]
35543 : * u1 = validate_array(u1, check_finite)
35544 : * qptr = extract(qnew, qs) # <<<<<<<<<<<<<<
35545 : * rptr = extract(rnew, rs)
35546 : * uptr = extract(u1, us)
35547 : */
35548 148 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_qnew, __pyx_v_qs);
35549 :
35550 : /* "scipy/linalg/_decomp_update.pyx":2067
35551 : * u1 = validate_array(u1, check_finite)
35552 : * qptr = extract(qnew, qs)
35553 : * rptr = extract(rnew, rs) # <<<<<<<<<<<<<<
35554 : * uptr = extract(u1, us)
35555 : * with nogil:
35556 : */
35557 148 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_rnew, __pyx_v_rs);
35558 :
35559 : /* "scipy/linalg/_decomp_update.pyx":2068
35560 : * qptr = extract(qnew, qs)
35561 : * rptr = extract(rnew, rs)
35562 : * uptr = extract(u1, us) # <<<<<<<<<<<<<<
35563 : * with nogil:
35564 : * if typecode == cnp.NPY_FLOAT:
35565 : */
35566 148 : __pyx_v_uptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u1, __pyx_v_us);
35567 :
35568 : /* "scipy/linalg/_decomp_update.pyx":2069
35569 : * rptr = extract(rnew, rs)
35570 : * uptr = extract(u1, us)
35571 : * with nogil: # <<<<<<<<<<<<<<
35572 : * if typecode == cnp.NPY_FLOAT:
35573 : * info = thin_qr_col_insert(m, n, <float*>qptr, qs,
35574 : */
35575 : {
35576 : #ifdef WITH_THREAD
35577 148 : PyThreadState *_save;
35578 148 : _save = NULL;
35579 148 : Py_UNBLOCK_THREADS
35580 148 : __Pyx_FastGIL_Remember();
35581 : #endif
35582 : /*try:*/ {
35583 :
35584 : /* "scipy/linalg/_decomp_update.pyx":2070
35585 : * uptr = extract(u1, us)
35586 : * with nogil:
35587 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
35588 : * info = thin_qr_col_insert(m, n, <float*>qptr, qs,
35589 : * <float*>rptr, rs, <float*>uptr, us, k, p_eco,
35590 : */
35591 148 : switch (__pyx_v_typecode) {
35592 37 : case NPY_FLOAT:
35593 :
35594 : /* "scipy/linalg/_decomp_update.pyx":2071
35595 : * with nogil:
35596 : * if typecode == cnp.NPY_FLOAT:
35597 : * info = thin_qr_col_insert(m, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
35598 : * <float*>rptr, rs, <float*>uptr, us, k, p_eco,
35599 : * p_full, &frc)
35600 : */
35601 37 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(__pyx_v_m, __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, ((float *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p_eco, __pyx_v_p_full, (&__pyx_v_frc));
35602 :
35603 : /* "scipy/linalg/_decomp_update.pyx":2070
35604 : * uptr = extract(u1, us)
35605 : * with nogil:
35606 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
35607 : * info = thin_qr_col_insert(m, n, <float*>qptr, qs,
35608 : * <float*>rptr, rs, <float*>uptr, us, k, p_eco,
35609 : */
35610 37 : break;
35611 37 : case NPY_DOUBLE:
35612 :
35613 : /* "scipy/linalg/_decomp_update.pyx":2075
35614 : * p_full, &frc)
35615 : * elif typecode == cnp.NPY_DOUBLE:
35616 : * info = thin_qr_col_insert(m, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
35617 : * <double*>rptr, rs, <double*>uptr, us, k, p_eco,
35618 : * p_full, &drc)
35619 : */
35620 37 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(__pyx_v_m, __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, ((double *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p_eco, __pyx_v_p_full, (&__pyx_v_drc));
35621 :
35622 : /* "scipy/linalg/_decomp_update.pyx":2074
35623 : * <float*>rptr, rs, <float*>uptr, us, k, p_eco,
35624 : * p_full, &frc)
35625 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
35626 : * info = thin_qr_col_insert(m, n, <double*>qptr, qs,
35627 : * <double*>rptr, rs, <double*>uptr, us, k, p_eco,
35628 : */
35629 37 : break;
35630 37 : case NPY_CFLOAT:
35631 :
35632 : /* "scipy/linalg/_decomp_update.pyx":2079
35633 : * p_full, &drc)
35634 : * elif typecode == cnp.NPY_CFLOAT:
35635 : * info = thin_qr_col_insert(m, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
35636 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k, p_eco,
35637 : * p_full, &cfrc)
35638 : */
35639 37 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(__pyx_v_m, __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_float_complex *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p_eco, __pyx_v_p_full, (&__pyx_v_cfrc));
35640 :
35641 : /* "scipy/linalg/_decomp_update.pyx":2078
35642 : * <double*>rptr, rs, <double*>uptr, us, k, p_eco,
35643 : * p_full, &drc)
35644 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
35645 : * info = thin_qr_col_insert(m, n, <float_complex*>qptr, qs,
35646 : * <float_complex*>rptr, rs, <float_complex*>uptr, us, k, p_eco,
35647 : */
35648 37 : break;
35649 37 : default:
35650 :
35651 : /* "scipy/linalg/_decomp_update.pyx":2083
35652 : * p_full, &cfrc)
35653 : * else: # typecode == cnp.NPY_CDOUBLE:
35654 : * info = thin_qr_col_insert(m, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
35655 : * <double_complex*>rptr, rs, <double_complex*>uptr, us, k, p_eco,
35656 : * p_full, &cdrc)
35657 : */
35658 37 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_col_insert(__pyx_v_m, __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_double_complex *)__pyx_v_uptr), __pyx_v_us, __pyx_v_k, __pyx_v_p_eco, __pyx_v_p_full, (&__pyx_v_cdrc));
35659 37 : break;
35660 : }
35661 : }
35662 :
35663 : /* "scipy/linalg/_decomp_update.pyx":2069
35664 : * rptr = extract(rnew, rs)
35665 : * uptr = extract(u1, us)
35666 : * with nogil: # <<<<<<<<<<<<<<
35667 : * if typecode == cnp.NPY_FLOAT:
35668 : * info = thin_qr_col_insert(m, n, <float*>qptr, qs,
35669 : */
35670 : /*finally:*/ {
35671 : /*normal exit:*/{
35672 : #ifdef WITH_THREAD
35673 148 : __Pyx_FastGIL_Forget();
35674 148 : Py_BLOCK_THREADS
35675 : #endif
35676 148 : goto __pyx_L19;
35677 : }
35678 148 : __pyx_L19:;
35679 : }
35680 : }
35681 :
35682 : /* "scipy/linalg/_decomp_update.pyx":2086
35683 : * <double_complex*>rptr, rs, <double_complex*>uptr, us, k, p_eco,
35684 : * p_full, &cdrc)
35685 : * if info == 2: # <<<<<<<<<<<<<<
35686 : * raise LinAlgError("One of the columns of u lies in the span of Q. "
35687 : * "Found reciprocal condition number of %s for Q "
35688 : */
35689 148 : __pyx_t_12 = (__pyx_v_info == 2);
35690 148 : if (unlikely(__pyx_t_12)) {
35691 :
35692 : /* "scipy/linalg/_decomp_update.pyx":2087
35693 : * p_full, &cdrc)
35694 : * if info == 2:
35695 : * raise LinAlgError("One of the columns of u lies in the span of Q. " # <<<<<<<<<<<<<<
35696 : * "Found reciprocal condition number of %s for Q "
35697 : * "augmented with u/||u||." % str(drc))
35698 : */
35699 4 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LinAlgError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2087, __pyx_L1_error)
35700 4 : __Pyx_GOTREF(__pyx_t_1);
35701 :
35702 : /* "scipy/linalg/_decomp_update.pyx":2089
35703 : * raise LinAlgError("One of the columns of u lies in the span of Q. "
35704 : * "Found reciprocal condition number of %s for Q "
35705 : * "augmented with u/||u||." % str(drc)) # <<<<<<<<<<<<<<
35706 : * elif info == MEMORY_ERROR:
35707 : * raise MemoryError("Unable to allocate memory for array")
35708 : */
35709 4 : __pyx_t_15 = PyFloat_FromDouble(__pyx_v_drc); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2089, __pyx_L1_error)
35710 4 : __Pyx_GOTREF(__pyx_t_15);
35711 4 : __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2089, __pyx_L1_error)
35712 4 : __Pyx_GOTREF(__pyx_t_7);
35713 4 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
35714 4 : __pyx_t_15 = PyUnicode_Format(__pyx_kp_u_One_of_the_columns_of_u_lies_in, __pyx_t_7); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2089, __pyx_L1_error)
35715 4 : __Pyx_GOTREF(__pyx_t_15);
35716 4 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
35717 4 : __pyx_t_7 = NULL;
35718 4 : __pyx_t_16 = 0;
35719 : #if CYTHON_UNPACK_METHODS
35720 4 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
35721 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
35722 0 : if (likely(__pyx_t_7)) {
35723 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
35724 0 : __Pyx_INCREF(__pyx_t_7);
35725 0 : __Pyx_INCREF(function);
35726 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
35727 : __pyx_t_16 = 1;
35728 : }
35729 : }
35730 : #endif
35731 : {
35732 4 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_15};
35733 4 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
35734 4 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
35735 4 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
35736 4 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2087, __pyx_L1_error)
35737 4 : __Pyx_GOTREF(__pyx_t_6);
35738 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35739 : }
35740 4 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
35741 4 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35742 4 : __PYX_ERR(0, 2087, __pyx_L1_error)
35743 :
35744 : /* "scipy/linalg/_decomp_update.pyx":2086
35745 : * <double_complex*>rptr, rs, <double_complex*>uptr, us, k, p_eco,
35746 : * p_full, &cdrc)
35747 : * if info == 2: # <<<<<<<<<<<<<<
35748 : * raise LinAlgError("One of the columns of u lies in the span of Q. "
35749 : * "Found reciprocal condition number of %s for Q "
35750 : */
35751 : }
35752 :
35753 : /* "scipy/linalg/_decomp_update.pyx":2090
35754 : * "Found reciprocal condition number of %s for Q "
35755 : * "augmented with u/||u||." % str(drc))
35756 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
35757 : * raise MemoryError("Unable to allocate memory for array")
35758 : * return qnew, rnew
35759 : */
35760 144 : __pyx_t_12 = (__pyx_v_info == __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR);
35761 144 : if (unlikely(__pyx_t_12)) {
35762 :
35763 : /* "scipy/linalg/_decomp_update.pyx":2091
35764 : * "augmented with u/||u||." % str(drc))
35765 : * elif info == MEMORY_ERROR:
35766 : * raise MemoryError("Unable to allocate memory for array") # <<<<<<<<<<<<<<
35767 : * return qnew, rnew
35768 : * else:
35769 : */
35770 0 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2091, __pyx_L1_error)
35771 0 : __Pyx_GOTREF(__pyx_t_6);
35772 0 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
35773 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35774 0 : __PYX_ERR(0, 2091, __pyx_L1_error)
35775 :
35776 : /* "scipy/linalg/_decomp_update.pyx":2090
35777 : * "Found reciprocal condition number of %s for Q "
35778 : * "augmented with u/||u||." % str(drc))
35779 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
35780 : * raise MemoryError("Unable to allocate memory for array")
35781 : * return qnew, rnew
35782 : */
35783 : }
35784 :
35785 : /* "scipy/linalg/_decomp_update.pyx":2092
35786 : * elif info == MEMORY_ERROR:
35787 : * raise MemoryError("Unable to allocate memory for array")
35788 : * return qnew, rnew # <<<<<<<<<<<<<<
35789 : * else:
35790 : * if (not cnp.PyArray_ISONESEGMENT(q1)) or u1.ndim == 2:
35791 : */
35792 144 : __Pyx_XDECREF(__pyx_r);
35793 144 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2092, __pyx_L1_error)
35794 144 : __Pyx_GOTREF(__pyx_t_6);
35795 144 : __Pyx_INCREF((PyObject *)__pyx_v_qnew);
35796 144 : __Pyx_GIVEREF((PyObject *)__pyx_v_qnew);
35797 144 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_qnew))) __PYX_ERR(0, 2092, __pyx_L1_error);
35798 144 : __Pyx_INCREF((PyObject *)__pyx_v_rnew);
35799 144 : __Pyx_GIVEREF((PyObject *)__pyx_v_rnew);
35800 144 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_rnew))) __PYX_ERR(0, 2092, __pyx_L1_error);
35801 144 : __pyx_r = __pyx_t_6;
35802 144 : __pyx_t_6 = 0;
35803 144 : goto __pyx_L0;
35804 :
35805 : /* "scipy/linalg/_decomp_update.pyx":2046
35806 : * return q1.copy(), rnew
35807 : *
35808 : * if economic: # <<<<<<<<<<<<<<
35809 : * if n+p <= m:
35810 : * p_eco = p
35811 : */
35812 : }
35813 :
35814 : /* "scipy/linalg/_decomp_update.pyx":2094
35815 : * return qnew, rnew
35816 : * else:
35817 : * if (not cnp.PyArray_ISONESEGMENT(q1)) or u1.ndim == 2: # <<<<<<<<<<<<<<
35818 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35819 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS)
35820 : */
35821 : /*else*/ {
35822 17906 : __pyx_t_11 = (!PyArray_ISONESEGMENT(__pyx_v_q1));
35823 17906 : if (!__pyx_t_11) {
35824 17810 : } else {
35825 96 : __pyx_t_12 = __pyx_t_11;
35826 96 : goto __pyx_L22_bool_binop_done;
35827 : }
35828 17810 : __pyx_t_11 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) == 2);
35829 17810 : __pyx_t_12 = __pyx_t_11;
35830 17906 : __pyx_L22_bool_binop_done:;
35831 17906 : if (__pyx_t_12) {
35832 :
35833 : /* "scipy/linalg/_decomp_update.pyx":2095
35834 : * else:
35835 : * if (not cnp.PyArray_ISONESEGMENT(q1)) or u1.ndim == 2:
35836 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
35837 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS)
35838 : * and (typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE)):
35839 : */
35840 632 : __pyx_t_6 = ((PyObject *)PyArray_FromArray(__pyx_v_q1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2095, __pyx_L1_error)
35841 632 : __Pyx_GOTREF(__pyx_t_6);
35842 632 : __Pyx_DECREF_SET(__pyx_v_q1, ((PyArrayObject *)__pyx_t_6));
35843 17906 : __pyx_t_6 = 0;
35844 :
35845 : /* "scipy/linalg/_decomp_update.pyx":2094
35846 : * return qnew, rnew
35847 : * else:
35848 : * if (not cnp.PyArray_ISONESEGMENT(q1)) or u1.ndim == 2: # <<<<<<<<<<<<<<
35849 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35850 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS)
35851 : */
35852 : }
35853 :
35854 : /* "scipy/linalg/_decomp_update.pyx":2096
35855 : * if (not cnp.PyArray_ISONESEGMENT(q1)) or u1.ndim == 2:
35856 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35857 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS) # <<<<<<<<<<<<<<
35858 : * and (typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE)):
35859 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY
35860 : */
35861 17906 : __pyx_t_11 = (!__pyx_v_overwrite_qru);
35862 17906 : if (__pyx_t_11) {
35863 716 : } else {
35864 17190 : __pyx_t_12 = __pyx_t_11;
35865 17190 : goto __pyx_L25_bool_binop_done;
35866 : }
35867 :
35868 : /* "scipy/linalg/_decomp_update.pyx":2097
35869 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35870 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS)
35871 : * and (typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE)): # <<<<<<<<<<<<<<
35872 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY
35873 : * u1 = PyArray_FromArray(u1, NULL, u_flags)
35874 : */
35875 716 : __pyx_t_11 = PyArray_CHKFLAGS(__pyx_v_q1, NPY_ARRAY_C_CONTIGUOUS);
35876 716 : if (__pyx_t_11) {
35877 28 : } else {
35878 688 : __pyx_t_12 = __pyx_t_11;
35879 688 : goto __pyx_L25_bool_binop_done;
35880 : }
35881 28 : switch (__pyx_v_typecode) {
35882 : case NPY_CFLOAT:
35883 : case NPY_CDOUBLE:
35884 : __pyx_t_11 = 1;
35885 : break;
35886 : default:
35887 : __pyx_t_11 = 0;
35888 : break;
35889 : }
35890 : __pyx_t_12 = __pyx_t_11;
35891 : __pyx_L25_bool_binop_done:;
35892 :
35893 : /* "scipy/linalg/_decomp_update.pyx":2096
35894 : * if (not cnp.PyArray_ISONESEGMENT(q1)) or u1.ndim == 2:
35895 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35896 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS) # <<<<<<<<<<<<<<
35897 : * and (typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE)):
35898 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY
35899 : */
35900 : if (__pyx_t_12) {
35901 :
35902 : /* "scipy/linalg/_decomp_update.pyx":2098
35903 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS)
35904 : * and (typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE)):
35905 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY # <<<<<<<<<<<<<<
35906 : * u1 = PyArray_FromArray(u1, NULL, u_flags)
35907 : *
35908 : */
35909 14 : __pyx_v_u_flags = (__pyx_v_u_flags | NPY_ARRAY_ENSURECOPY);
35910 :
35911 : /* "scipy/linalg/_decomp_update.pyx":2099
35912 : * and (typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE)):
35913 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY
35914 : * u1 = PyArray_FromArray(u1, NULL, u_flags) # <<<<<<<<<<<<<<
35915 : *
35916 : * shape[0] = m
35917 : */
35918 14 : __pyx_t_6 = ((PyObject *)PyArray_FromArray(__pyx_v_u1, NULL, __pyx_v_u_flags)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2099, __pyx_L1_error)
35919 14 : __Pyx_GOTREF(__pyx_t_6);
35920 14 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_6));
35921 17906 : __pyx_t_6 = 0;
35922 :
35923 : /* "scipy/linalg/_decomp_update.pyx":2096
35924 : * if (not cnp.PyArray_ISONESEGMENT(q1)) or u1.ndim == 2:
35925 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
35926 : * if (not overwrite_qru and cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_C_CONTIGUOUS) # <<<<<<<<<<<<<<
35927 : * and (typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE)):
35928 : * u_flags |= cnp.NPY_ARRAY_ENSURECOPY
35929 : */
35930 : }
35931 :
35932 : /* "scipy/linalg/_decomp_update.pyx":2101
35933 : * u1 = PyArray_FromArray(u1, NULL, u_flags)
35934 : *
35935 : * shape[0] = m # <<<<<<<<<<<<<<
35936 : * shape[1] = n+p
35937 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35938 : */
35939 17906 : (__pyx_v_shape[0]) = __pyx_v_m;
35940 :
35941 : /* "scipy/linalg/_decomp_update.pyx":2102
35942 : *
35943 : * shape[0] = m
35944 : * shape[1] = n+p # <<<<<<<<<<<<<<
35945 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35946 : *
35947 : */
35948 17906 : (__pyx_v_shape[1]) = (__pyx_v_n + __pyx_v_p);
35949 :
35950 : /* "scipy/linalg/_decomp_update.pyx":2103
35951 : * shape[0] = m
35952 : * shape[1] = n+p
35953 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1) # <<<<<<<<<<<<<<
35954 : *
35955 : * rnew[:,:k] = r1[:,:k]
35956 : */
35957 17906 : __pyx_t_6 = PyArray_ZEROS(2, __pyx_v_shape, __pyx_v_typecode, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2103, __pyx_L1_error)
35958 17906 : __Pyx_GOTREF(__pyx_t_6);
35959 17906 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2103, __pyx_L1_error)
35960 17906 : __pyx_v_rnew = ((PyArrayObject *)__pyx_t_6);
35961 17906 : __pyx_t_6 = 0;
35962 :
35963 : /* "scipy/linalg/_decomp_update.pyx":2105
35964 : * rnew = cnp.PyArray_ZEROS(2, shape, typecode, 1)
35965 : *
35966 : * rnew[:,:k] = r1[:,:k] # <<<<<<<<<<<<<<
35967 : * rnew[:,k+p:] = r1[:,k:]
35968 : *
35969 : */
35970 17906 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2105, __pyx_L1_error)
35971 17906 : __Pyx_GOTREF(__pyx_t_6);
35972 17906 : __pyx_t_1 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2105, __pyx_L1_error)
35973 17906 : __Pyx_GOTREF(__pyx_t_1);
35974 17906 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35975 17906 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2105, __pyx_L1_error)
35976 17906 : __Pyx_GOTREF(__pyx_t_6);
35977 17906 : __Pyx_INCREF(__pyx_slice__16);
35978 17906 : __Pyx_GIVEREF(__pyx_slice__16);
35979 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__16)) __PYX_ERR(0, 2105, __pyx_L1_error);
35980 17906 : __Pyx_GIVEREF(__pyx_t_1);
35981 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(0, 2105, __pyx_L1_error);
35982 17906 : __pyx_t_1 = 0;
35983 17906 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2105, __pyx_L1_error)
35984 17906 : __Pyx_GOTREF(__pyx_t_1);
35985 17906 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35986 17906 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2105, __pyx_L1_error)
35987 17906 : __Pyx_GOTREF(__pyx_t_6);
35988 17906 : __pyx_t_15 = PySlice_New(Py_None, __pyx_t_6, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2105, __pyx_L1_error)
35989 17906 : __Pyx_GOTREF(__pyx_t_15);
35990 17906 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35991 17906 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2105, __pyx_L1_error)
35992 17906 : __Pyx_GOTREF(__pyx_t_6);
35993 17906 : __Pyx_INCREF(__pyx_slice__16);
35994 17906 : __Pyx_GIVEREF(__pyx_slice__16);
35995 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__16)) __PYX_ERR(0, 2105, __pyx_L1_error);
35996 17906 : __Pyx_GIVEREF(__pyx_t_15);
35997 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_15)) __PYX_ERR(0, 2105, __pyx_L1_error);
35998 17906 : __pyx_t_15 = 0;
35999 17906 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rnew), __pyx_t_6, __pyx_t_1) < 0))) __PYX_ERR(0, 2105, __pyx_L1_error)
36000 17906 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36001 17906 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36002 :
36003 : /* "scipy/linalg/_decomp_update.pyx":2106
36004 : *
36005 : * rnew[:,:k] = r1[:,:k]
36006 : * rnew[:,k+p:] = r1[:,k:] # <<<<<<<<<<<<<<
36007 : *
36008 : * u1 = validate_array(u1, check_finite)
36009 : */
36010 17906 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
36011 17906 : __Pyx_GOTREF(__pyx_t_1);
36012 17906 : __pyx_t_6 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2106, __pyx_L1_error)
36013 17906 : __Pyx_GOTREF(__pyx_t_6);
36014 17906 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36015 17906 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
36016 17906 : __Pyx_GOTREF(__pyx_t_1);
36017 17906 : __Pyx_INCREF(__pyx_slice__16);
36018 17906 : __Pyx_GIVEREF(__pyx_slice__16);
36019 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__16)) __PYX_ERR(0, 2106, __pyx_L1_error);
36020 17906 : __Pyx_GIVEREF(__pyx_t_6);
36021 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2106, __pyx_L1_error);
36022 17906 : __pyx_t_6 = 0;
36023 17906 : __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_r1), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2106, __pyx_L1_error)
36024 17906 : __Pyx_GOTREF(__pyx_t_6);
36025 17906 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36026 17906 : __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_k + __pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
36027 17906 : __Pyx_GOTREF(__pyx_t_1);
36028 17906 : __pyx_t_15 = PySlice_New(__pyx_t_1, Py_None, Py_None); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2106, __pyx_L1_error)
36029 17906 : __Pyx_GOTREF(__pyx_t_15);
36030 17906 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36031 17906 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error)
36032 17906 : __Pyx_GOTREF(__pyx_t_1);
36033 17906 : __Pyx_INCREF(__pyx_slice__16);
36034 17906 : __Pyx_GIVEREF(__pyx_slice__16);
36035 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__16)) __PYX_ERR(0, 2106, __pyx_L1_error);
36036 17906 : __Pyx_GIVEREF(__pyx_t_15);
36037 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_15)) __PYX_ERR(0, 2106, __pyx_L1_error);
36038 17906 : __pyx_t_15 = 0;
36039 17906 : if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_rnew), __pyx_t_1, __pyx_t_6) < 0))) __PYX_ERR(0, 2106, __pyx_L1_error)
36040 17906 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36041 17906 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36042 :
36043 : /* "scipy/linalg/_decomp_update.pyx":2108
36044 : * rnew[:,k+p:] = r1[:,k:]
36045 : *
36046 : * u1 = validate_array(u1, check_finite) # <<<<<<<<<<<<<<
36047 : * rptr = extract(rnew, rs)
36048 : * form_qTu(q1, u1, rptr, rs, k)
36049 : */
36050 17906 : __pyx_t_6 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_u1, __pyx_v_check_finite); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2108, __pyx_L1_error)
36051 17906 : __Pyx_GOTREF(__pyx_t_6);
36052 17906 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2108, __pyx_L1_error)
36053 17906 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_6));
36054 17906 : __pyx_t_6 = 0;
36055 :
36056 : /* "scipy/linalg/_decomp_update.pyx":2109
36057 : *
36058 : * u1 = validate_array(u1, check_finite)
36059 : * rptr = extract(rnew, rs) # <<<<<<<<<<<<<<
36060 : * form_qTu(q1, u1, rptr, rs, k)
36061 : * if not overwrite_qru:
36062 : */
36063 17906 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_rnew, __pyx_v_rs);
36064 :
36065 : /* "scipy/linalg/_decomp_update.pyx":2110
36066 : * u1 = validate_array(u1, check_finite)
36067 : * rptr = extract(rnew, rs)
36068 : * form_qTu(q1, u1, rptr, rs, k) # <<<<<<<<<<<<<<
36069 : * if not overwrite_qru:
36070 : * q1 = q1.copy('F')
36071 : */
36072 17906 : __pyx_t_6 = __pyx_f_5scipy_6linalg_14_decomp_update_form_qTu(__pyx_v_q1, __pyx_v_u1, __pyx_v_rptr, __pyx_v_rs, __pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2110, __pyx_L1_error)
36073 17906 : __Pyx_GOTREF(__pyx_t_6);
36074 17906 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36075 :
36076 : /* "scipy/linalg/_decomp_update.pyx":2111
36077 : * rptr = extract(rnew, rs)
36078 : * form_qTu(q1, u1, rptr, rs, k)
36079 : * if not overwrite_qru: # <<<<<<<<<<<<<<
36080 : * q1 = q1.copy('F')
36081 : *
36082 : */
36083 17906 : __pyx_t_12 = (!__pyx_v_overwrite_qru);
36084 17906 : if (__pyx_t_12) {
36085 :
36086 : /* "scipy/linalg/_decomp_update.pyx":2112
36087 : * form_qTu(q1, u1, rptr, rs, k)
36088 : * if not overwrite_qru:
36089 : * q1 = q1.copy('F') # <<<<<<<<<<<<<<
36090 : *
36091 : * qptr = extract(q1, qs)
36092 : */
36093 716 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_q1), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2112, __pyx_L1_error)
36094 716 : __Pyx_GOTREF(__pyx_t_1);
36095 716 : __pyx_t_15 = NULL;
36096 716 : __pyx_t_16 = 0;
36097 : #if CYTHON_UNPACK_METHODS
36098 716 : if (likely(PyMethod_Check(__pyx_t_1))) {
36099 0 : __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_1);
36100 0 : if (likely(__pyx_t_15)) {
36101 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
36102 0 : __Pyx_INCREF(__pyx_t_15);
36103 0 : __Pyx_INCREF(function);
36104 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
36105 : __pyx_t_16 = 1;
36106 : }
36107 : }
36108 : #endif
36109 : {
36110 716 : PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_n_u_F};
36111 716 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
36112 716 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
36113 716 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2112, __pyx_L1_error)
36114 716 : __Pyx_GOTREF(__pyx_t_6);
36115 716 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36116 : }
36117 716 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2112, __pyx_L1_error)
36118 716 : __Pyx_DECREF_SET(__pyx_v_q1, ((PyArrayObject *)__pyx_t_6));
36119 : __pyx_t_6 = 0;
36120 :
36121 : /* "scipy/linalg/_decomp_update.pyx":2111
36122 : * rptr = extract(rnew, rs)
36123 : * form_qTu(q1, u1, rptr, rs, k)
36124 : * if not overwrite_qru: # <<<<<<<<<<<<<<
36125 : * q1 = q1.copy('F')
36126 : *
36127 : */
36128 : }
36129 :
36130 : /* "scipy/linalg/_decomp_update.pyx":2114
36131 : * q1 = q1.copy('F')
36132 : *
36133 : * qptr = extract(q1, qs) # <<<<<<<<<<<<<<
36134 : * if p == 1:
36135 : * with nogil:
36136 : */
36137 17906 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q1, __pyx_v_qs);
36138 :
36139 : /* "scipy/linalg/_decomp_update.pyx":2115
36140 : *
36141 : * qptr = extract(q1, qs)
36142 : * if p == 1: # <<<<<<<<<<<<<<
36143 : * with nogil:
36144 : * if typecode == cnp.NPY_FLOAT:
36145 : */
36146 17906 : __pyx_t_12 = (__pyx_v_p == 1);
36147 17906 : if (__pyx_t_12) {
36148 :
36149 : /* "scipy/linalg/_decomp_update.pyx":2116
36150 : * qptr = extract(q1, qs)
36151 : * if p == 1:
36152 : * with nogil: # <<<<<<<<<<<<<<
36153 : * if typecode == cnp.NPY_FLOAT:
36154 : * qr_col_insert(m, n+p, <float*>qptr, qs,
36155 : */
36156 : {
36157 : #ifdef WITH_THREAD
36158 17322 : PyThreadState *_save;
36159 17322 : _save = NULL;
36160 17322 : Py_UNBLOCK_THREADS
36161 17322 : __Pyx_FastGIL_Remember();
36162 : #endif
36163 : /*try:*/ {
36164 :
36165 : /* "scipy/linalg/_decomp_update.pyx":2117
36166 : * if p == 1:
36167 : * with nogil:
36168 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
36169 : * qr_col_insert(m, n+p, <float*>qptr, qs,
36170 : * <float*>rptr, rs, k)
36171 : */
36172 17322 : switch (__pyx_v_typecode) {
36173 132 : case NPY_FLOAT:
36174 :
36175 : /* "scipy/linalg/_decomp_update.pyx":2118
36176 : * with nogil:
36177 : * if typecode == cnp.NPY_FLOAT:
36178 : * qr_col_insert(m, n+p, <float*>qptr, qs, # <<<<<<<<<<<<<<
36179 : * <float*>rptr, rs, k)
36180 : * elif typecode == cnp.NPY_DOUBLE:
36181 : */
36182 132 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
36183 :
36184 : /* "scipy/linalg/_decomp_update.pyx":2117
36185 : * if p == 1:
36186 : * with nogil:
36187 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
36188 : * qr_col_insert(m, n+p, <float*>qptr, qs,
36189 : * <float*>rptr, rs, k)
36190 : */
36191 132 : break;
36192 16378 : case NPY_DOUBLE:
36193 :
36194 : /* "scipy/linalg/_decomp_update.pyx":2121
36195 : * <float*>rptr, rs, k)
36196 : * elif typecode == cnp.NPY_DOUBLE:
36197 : * qr_col_insert(m, n+p, <double*>qptr, qs, # <<<<<<<<<<<<<<
36198 : * <double*>rptr, rs, k)
36199 : * elif typecode == cnp.NPY_CFLOAT:
36200 : */
36201 16378 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
36202 :
36203 : /* "scipy/linalg/_decomp_update.pyx":2120
36204 : * qr_col_insert(m, n+p, <float*>qptr, qs,
36205 : * <float*>rptr, rs, k)
36206 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
36207 : * qr_col_insert(m, n+p, <double*>qptr, qs,
36208 : * <double*>rptr, rs, k)
36209 : */
36210 16378 : break;
36211 132 : case NPY_CFLOAT:
36212 :
36213 : /* "scipy/linalg/_decomp_update.pyx":2124
36214 : * <double*>rptr, rs, k)
36215 : * elif typecode == cnp.NPY_CFLOAT:
36216 : * qr_col_insert(m, n+p, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
36217 : * <float_complex*>rptr, rs, k)
36218 : * else: # typecode == cnp.NPY_CDOUBLE:
36219 : */
36220 132 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
36221 :
36222 : /* "scipy/linalg/_decomp_update.pyx":2123
36223 : * qr_col_insert(m, n+p, <double*>qptr, qs,
36224 : * <double*>rptr, rs, k)
36225 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
36226 : * qr_col_insert(m, n+p, <float_complex*>qptr, qs,
36227 : * <float_complex*>rptr, rs, k)
36228 : */
36229 132 : break;
36230 680 : default:
36231 :
36232 : /* "scipy/linalg/_decomp_update.pyx":2127
36233 : * <float_complex*>rptr, rs, k)
36234 : * else: # typecode == cnp.NPY_CDOUBLE:
36235 : * qr_col_insert(m, n+p, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
36236 : * <double_complex*>rptr, rs, k)
36237 : * else:
36238 : */
36239 680 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k);
36240 680 : break;
36241 : }
36242 : }
36243 :
36244 : /* "scipy/linalg/_decomp_update.pyx":2116
36245 : * qptr = extract(q1, qs)
36246 : * if p == 1:
36247 : * with nogil: # <<<<<<<<<<<<<<
36248 : * if typecode == cnp.NPY_FLOAT:
36249 : * qr_col_insert(m, n+p, <float*>qptr, qs,
36250 : */
36251 : /*finally:*/ {
36252 : /*normal exit:*/{
36253 : #ifdef WITH_THREAD
36254 17322 : __Pyx_FastGIL_Forget();
36255 17322 : Py_BLOCK_THREADS
36256 : #endif
36257 17322 : goto __pyx_L32;
36258 : }
36259 17322 : __pyx_L32:;
36260 : }
36261 : }
36262 :
36263 : /* "scipy/linalg/_decomp_update.pyx":2115
36264 : *
36265 : * qptr = extract(q1, qs)
36266 : * if p == 1: # <<<<<<<<<<<<<<
36267 : * with nogil:
36268 : * if typecode == cnp.NPY_FLOAT:
36269 : */
36270 17322 : goto __pyx_L29;
36271 : }
36272 :
36273 : /* "scipy/linalg/_decomp_update.pyx":2130
36274 : * <double_complex*>rptr, rs, k)
36275 : * else:
36276 : * with nogil: # <<<<<<<<<<<<<<
36277 : * if typecode == cnp.NPY_FLOAT:
36278 : * info = qr_block_col_insert(m, n+p, <float*>qptr, qs,
36279 : */
36280 : /*else*/ {
36281 : {
36282 : #ifdef WITH_THREAD
36283 584 : PyThreadState *_save;
36284 584 : _save = NULL;
36285 584 : Py_UNBLOCK_THREADS
36286 584 : __Pyx_FastGIL_Remember();
36287 : #endif
36288 : /*try:*/ {
36289 :
36290 : /* "scipy/linalg/_decomp_update.pyx":2131
36291 : * else:
36292 : * with nogil:
36293 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
36294 : * info = qr_block_col_insert(m, n+p, <float*>qptr, qs,
36295 : * <float*>rptr, rs, k, p)
36296 : */
36297 584 : switch (__pyx_v_typecode) {
36298 146 : case NPY_FLOAT:
36299 :
36300 : /* "scipy/linalg/_decomp_update.pyx":2132
36301 : * with nogil:
36302 : * if typecode == cnp.NPY_FLOAT:
36303 : * info = qr_block_col_insert(m, n+p, <float*>qptr, qs, # <<<<<<<<<<<<<<
36304 : * <float*>rptr, rs, k, p)
36305 : * elif typecode == cnp.NPY_DOUBLE:
36306 : */
36307 146 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
36308 :
36309 : /* "scipy/linalg/_decomp_update.pyx":2131
36310 : * else:
36311 : * with nogil:
36312 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
36313 : * info = qr_block_col_insert(m, n+p, <float*>qptr, qs,
36314 : * <float*>rptr, rs, k, p)
36315 : */
36316 146 : break;
36317 146 : case NPY_DOUBLE:
36318 :
36319 : /* "scipy/linalg/_decomp_update.pyx":2135
36320 : * <float*>rptr, rs, k, p)
36321 : * elif typecode == cnp.NPY_DOUBLE:
36322 : * info = qr_block_col_insert(m, n+p, <double*>qptr, qs, # <<<<<<<<<<<<<<
36323 : * <double*>rptr, rs, k, p)
36324 : * elif typecode == cnp.NPY_CFLOAT:
36325 : */
36326 146 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
36327 :
36328 : /* "scipy/linalg/_decomp_update.pyx":2134
36329 : * info = qr_block_col_insert(m, n+p, <float*>qptr, qs,
36330 : * <float*>rptr, rs, k, p)
36331 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
36332 : * info = qr_block_col_insert(m, n+p, <double*>qptr, qs,
36333 : * <double*>rptr, rs, k, p)
36334 : */
36335 146 : break;
36336 146 : case NPY_CFLOAT:
36337 :
36338 : /* "scipy/linalg/_decomp_update.pyx":2138
36339 : * <double*>rptr, rs, k, p)
36340 : * elif typecode == cnp.NPY_CFLOAT:
36341 : * info = qr_block_col_insert(m, n+p, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
36342 : * <float_complex*>rptr, rs, k, p)
36343 : * else: # typecode == cnp.NPY_CDOUBLE:
36344 : */
36345 146 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
36346 :
36347 : /* "scipy/linalg/_decomp_update.pyx":2137
36348 : * info = qr_block_col_insert(m, n+p, <double*>qptr, qs,
36349 : * <double*>rptr, rs, k, p)
36350 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
36351 : * info = qr_block_col_insert(m, n+p, <float_complex*>qptr, qs,
36352 : * <float_complex*>rptr, rs, k, p)
36353 : */
36354 146 : break;
36355 146 : default:
36356 :
36357 : /* "scipy/linalg/_decomp_update.pyx":2141
36358 : * <float_complex*>rptr, rs, k, p)
36359 : * else: # typecode == cnp.NPY_CDOUBLE:
36360 : * info = qr_block_col_insert(m, n+p, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
36361 : * <double_complex*>rptr, rs, k, p)
36362 : * if info != 0:
36363 : */
36364 146 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_block_col_insert(__pyx_v_m, (__pyx_v_n + __pyx_v_p), ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, __pyx_v_k, __pyx_v_p);
36365 146 : break;
36366 : }
36367 : }
36368 :
36369 : /* "scipy/linalg/_decomp_update.pyx":2130
36370 : * <double_complex*>rptr, rs, k)
36371 : * else:
36372 : * with nogil: # <<<<<<<<<<<<<<
36373 : * if typecode == cnp.NPY_FLOAT:
36374 : * info = qr_block_col_insert(m, n+p, <float*>qptr, qs,
36375 : */
36376 : /*finally:*/ {
36377 : /*normal exit:*/{
36378 : #ifdef WITH_THREAD
36379 584 : __Pyx_FastGIL_Forget();
36380 584 : Py_BLOCK_THREADS
36381 : #endif
36382 584 : goto __pyx_L35;
36383 : }
36384 584 : __pyx_L35:;
36385 : }
36386 : }
36387 :
36388 : /* "scipy/linalg/_decomp_update.pyx":2143
36389 : * info = qr_block_col_insert(m, n+p, <double_complex*>qptr, qs,
36390 : * <double_complex*>rptr, rs, k, p)
36391 : * if info != 0: # <<<<<<<<<<<<<<
36392 : * if info > 0:
36393 : * raise ValueError('The {0}th argument to ?geqrf was '
36394 : */
36395 584 : __pyx_t_12 = (__pyx_v_info != 0);
36396 584 : if (__pyx_t_12) {
36397 :
36398 : /* "scipy/linalg/_decomp_update.pyx":2144
36399 : * <double_complex*>rptr, rs, k, p)
36400 : * if info != 0:
36401 : * if info > 0: # <<<<<<<<<<<<<<
36402 : * raise ValueError('The {0}th argument to ?geqrf was '
36403 : * 'invalid'.format(info))
36404 : */
36405 0 : __pyx_t_12 = (__pyx_v_info > 0);
36406 0 : if (unlikely(__pyx_t_12)) {
36407 :
36408 : /* "scipy/linalg/_decomp_update.pyx":2146
36409 : * if info > 0:
36410 : * raise ValueError('The {0}th argument to ?geqrf was '
36411 : * 'invalid'.format(info)) # <<<<<<<<<<<<<<
36412 : * elif info < 0:
36413 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
36414 : */
36415 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_0_th_argument_to_geqrf_was_i, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error)
36416 0 : __Pyx_GOTREF(__pyx_t_1);
36417 0 : __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_info); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2146, __pyx_L1_error)
36418 0 : __Pyx_GOTREF(__pyx_t_15);
36419 0 : __pyx_t_7 = NULL;
36420 0 : __pyx_t_16 = 0;
36421 : #if CYTHON_UNPACK_METHODS
36422 0 : if (likely(PyMethod_Check(__pyx_t_1))) {
36423 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
36424 0 : if (likely(__pyx_t_7)) {
36425 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
36426 0 : __Pyx_INCREF(__pyx_t_7);
36427 0 : __Pyx_INCREF(function);
36428 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
36429 : __pyx_t_16 = 1;
36430 : }
36431 : }
36432 : #endif
36433 : {
36434 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_15};
36435 0 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
36436 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
36437 0 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
36438 0 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2146, __pyx_L1_error)
36439 0 : __Pyx_GOTREF(__pyx_t_6);
36440 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36441 : }
36442 :
36443 : /* "scipy/linalg/_decomp_update.pyx":2145
36444 : * if info != 0:
36445 : * if info > 0:
36446 : * raise ValueError('The {0}th argument to ?geqrf was ' # <<<<<<<<<<<<<<
36447 : * 'invalid'.format(info))
36448 : * elif info < 0:
36449 : */
36450 0 : __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __pyx_L1_error)
36451 0 : __Pyx_GOTREF(__pyx_t_1);
36452 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36453 0 : __Pyx_Raise(__pyx_t_1, 0, 0, 0);
36454 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36455 0 : __PYX_ERR(0, 2145, __pyx_L1_error)
36456 :
36457 : /* "scipy/linalg/_decomp_update.pyx":2144
36458 : * <double_complex*>rptr, rs, k, p)
36459 : * if info != 0:
36460 : * if info > 0: # <<<<<<<<<<<<<<
36461 : * raise ValueError('The {0}th argument to ?geqrf was '
36462 : * 'invalid'.format(info))
36463 : */
36464 : }
36465 :
36466 : /* "scipy/linalg/_decomp_update.pyx":2147
36467 : * raise ValueError('The {0}th argument to ?geqrf was '
36468 : * 'invalid'.format(info))
36469 : * elif info < 0: # <<<<<<<<<<<<<<
36470 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
36471 : * 'invalid'.format(abs(info)))
36472 : */
36473 0 : __pyx_t_12 = (__pyx_v_info < 0);
36474 0 : if (unlikely(__pyx_t_12)) {
36475 :
36476 : /* "scipy/linalg/_decomp_update.pyx":2149
36477 : * elif info < 0:
36478 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
36479 : * 'invalid'.format(abs(info))) # <<<<<<<<<<<<<<
36480 : * elif info == MEMORY_ERROR:
36481 : * raise MemoryError("Unable to allocate memory for array")
36482 : */
36483 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_0_th_argument_to_ormqr_unmqr, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2149, __pyx_L1_error)
36484 0 : __Pyx_GOTREF(__pyx_t_6);
36485 0 : __pyx_t_10 = abs(__pyx_v_info); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 2149, __pyx_L1_error)
36486 0 : __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2149, __pyx_L1_error)
36487 0 : __Pyx_GOTREF(__pyx_t_15);
36488 0 : __pyx_t_7 = NULL;
36489 0 : __pyx_t_16 = 0;
36490 : #if CYTHON_UNPACK_METHODS
36491 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
36492 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
36493 0 : if (likely(__pyx_t_7)) {
36494 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
36495 0 : __Pyx_INCREF(__pyx_t_7);
36496 0 : __Pyx_INCREF(function);
36497 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
36498 : __pyx_t_16 = 1;
36499 : }
36500 : }
36501 : #endif
36502 : {
36503 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_15};
36504 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_16, 1+__pyx_t_16);
36505 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
36506 0 : __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
36507 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2149, __pyx_L1_error)
36508 0 : __Pyx_GOTREF(__pyx_t_1);
36509 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36510 : }
36511 :
36512 : /* "scipy/linalg/_decomp_update.pyx":2148
36513 : * 'invalid'.format(info))
36514 : * elif info < 0:
36515 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was ' # <<<<<<<<<<<<<<
36516 : * 'invalid'.format(abs(info)))
36517 : * elif info == MEMORY_ERROR:
36518 : */
36519 0 : __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2148, __pyx_L1_error)
36520 0 : __Pyx_GOTREF(__pyx_t_6);
36521 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36522 0 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
36523 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36524 0 : __PYX_ERR(0, 2148, __pyx_L1_error)
36525 :
36526 : /* "scipy/linalg/_decomp_update.pyx":2147
36527 : * raise ValueError('The {0}th argument to ?geqrf was '
36528 : * 'invalid'.format(info))
36529 : * elif info < 0: # <<<<<<<<<<<<<<
36530 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
36531 : * 'invalid'.format(abs(info)))
36532 : */
36533 : }
36534 :
36535 : /* "scipy/linalg/_decomp_update.pyx":2150
36536 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
36537 : * 'invalid'.format(abs(info)))
36538 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
36539 : * raise MemoryError("Unable to allocate memory for array")
36540 : * return q1, rnew
36541 : */
36542 : __pyx_t_12 = (__pyx_v_info == __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR);
36543 : if (unlikely(__pyx_t_12)) {
36544 :
36545 : /* "scipy/linalg/_decomp_update.pyx":2151
36546 : * 'invalid'.format(abs(info)))
36547 : * elif info == MEMORY_ERROR:
36548 : * raise MemoryError("Unable to allocate memory for array") # <<<<<<<<<<<<<<
36549 : * return q1, rnew
36550 : *
36551 : */
36552 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2151, __pyx_L1_error)
36553 : __Pyx_GOTREF(__pyx_t_6);
36554 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
36555 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36556 : __PYX_ERR(0, 2151, __pyx_L1_error)
36557 :
36558 : /* "scipy/linalg/_decomp_update.pyx":2150
36559 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
36560 : * 'invalid'.format(abs(info)))
36561 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
36562 : * raise MemoryError("Unable to allocate memory for array")
36563 : * return q1, rnew
36564 : */
36565 : }
36566 :
36567 : /* "scipy/linalg/_decomp_update.pyx":2143
36568 : * info = qr_block_col_insert(m, n+p, <double_complex*>qptr, qs,
36569 : * <double_complex*>rptr, rs, k, p)
36570 : * if info != 0: # <<<<<<<<<<<<<<
36571 : * if info > 0:
36572 : * raise ValueError('The {0}th argument to ?geqrf was '
36573 : */
36574 : }
36575 : }
36576 584 : __pyx_L29:;
36577 :
36578 : /* "scipy/linalg/_decomp_update.pyx":2152
36579 : * elif info == MEMORY_ERROR:
36580 : * raise MemoryError("Unable to allocate memory for array")
36581 : * return q1, rnew # <<<<<<<<<<<<<<
36582 : *
36583 : * @cython.embedsignature(True)
36584 : */
36585 17906 : __Pyx_XDECREF(__pyx_r);
36586 17906 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2152, __pyx_L1_error)
36587 17906 : __Pyx_GOTREF(__pyx_t_6);
36588 17906 : __Pyx_INCREF((PyObject *)__pyx_v_q1);
36589 17906 : __Pyx_GIVEREF((PyObject *)__pyx_v_q1);
36590 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_q1))) __PYX_ERR(0, 2152, __pyx_L1_error);
36591 17906 : __Pyx_INCREF((PyObject *)__pyx_v_rnew);
36592 17906 : __Pyx_GIVEREF((PyObject *)__pyx_v_rnew);
36593 17906 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_rnew))) __PYX_ERR(0, 2152, __pyx_L1_error);
36594 17906 : __pyx_r = __pyx_t_6;
36595 17906 : __pyx_t_6 = 0;
36596 17906 : goto __pyx_L0;
36597 : }
36598 :
36599 : /* "scipy/linalg/_decomp_update.pyx":1979
36600 : * return qnew, rnew
36601 : *
36602 : * cdef qr_insert_col(Q, R, u, int k, rcond, bint overwrite_qru, bint check_finite): # <<<<<<<<<<<<<<
36603 : * cdef cnp.ndarray q1, r1, u1, qnew, rnew
36604 : * cdef int j
36605 : */
36606 :
36607 : /* function exit code */
36608 208 : __pyx_L1_error:;
36609 208 : __Pyx_XDECREF(__pyx_t_1);
36610 208 : __Pyx_XDECREF(__pyx_t_2);
36611 208 : __Pyx_XDECREF(__pyx_t_3);
36612 208 : __Pyx_XDECREF(__pyx_t_4);
36613 208 : __Pyx_XDECREF(__pyx_t_5);
36614 208 : __Pyx_XDECREF(__pyx_t_6);
36615 208 : __Pyx_XDECREF(__pyx_t_7);
36616 208 : __Pyx_XDECREF(__pyx_t_15);
36617 208 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_insert_col", __pyx_clineno, __pyx_lineno, __pyx_filename);
36618 208 : __pyx_r = 0;
36619 18346 : __pyx_L0:;
36620 18346 : __Pyx_XDECREF((PyObject *)__pyx_v_q1);
36621 18346 : __Pyx_XDECREF((PyObject *)__pyx_v_r1);
36622 18346 : __Pyx_XDECREF((PyObject *)__pyx_v_u1);
36623 18346 : __Pyx_XDECREF((PyObject *)__pyx_v_qnew);
36624 18346 : __Pyx_XDECREF((PyObject *)__pyx_v_rnew);
36625 18346 : __Pyx_XGIVEREF(__pyx_r);
36626 18346 : __Pyx_RefNannyFinishContext();
36627 18346 : return __pyx_r;
36628 : }
36629 :
36630 : /* "scipy/linalg/_decomp_update.pyx":2154
36631 : * return q1, rnew
36632 : *
36633 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
36634 : * def qr_update(Q, R, u, v, overwrite_qruv=False, check_finite=True):
36635 : * """
36636 : */
36637 :
36638 : /* Python wrapper */
36639 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_7qr_update(PyObject *__pyx_self,
36640 : #if CYTHON_METH_FASTCALL
36641 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
36642 : #else
36643 : PyObject *__pyx_args, PyObject *__pyx_kwds
36644 : #endif
36645 : ); /*proto*/
36646 : PyDoc_STRVAR(__pyx_doc_5scipy_6linalg_14_decomp_update_6qr_update, "qr_update(Q, R, u, v, overwrite_qruv=False, check_finite=True)\n\n Rank-k QR update\n\n If ``A = Q R`` is the QR factorization of ``A``, return the QR\n factorization of ``A + u v**T`` for real ``A`` or ``A + u v**H``\n for complex ``A``.\n\n Parameters\n ----------\n Q : (M, M) or (M, N) array_like\n Unitary/orthogonal matrix from the qr decomposition of A.\n R : (M, N) or (N, N) array_like\n Upper triangular matrix from the qr decomposition of A.\n u : (M,) or (M, k) array_like\n Left update vector\n v : (N,) or (N, k) array_like\n Right update vector\n overwrite_qruv : bool, optional\n If True, consume Q, R, u, and v, if possible, while performing the\n update, otherwise make copies as necessary. Defaults to False.\n check_finite : bool, optional\n Whether to check that the input matrix contains only finite numbers.\n Disabling may give a performance gain, but may result in problems\n (crashes, non-termination) if the inputs do contain infinities or NaNs.\n Default is True.\n\n Returns\n -------\n Q1 : ndarray\n Updated unitary/orthogonal factor\n R1 : ndarray\n Updated upper triangular factor\n\n See Also\n --------\n qr, qr_multiply, qr_delete, qr_insert\n\n Notes\n -----\n This routine does not guarantee that the diagonal entries of `R1` are\n real or positive.\n\n .. versionadded:: 0.16.0\n\n References\n ----------\n .. [1] Golub, G. H. & Van Loan, C. F. Matrix Computations, 3rd Ed.\n (Johns Hopkins University Press, 1996).\n\n .. [2] Daniel, J. W., Gragg, W. B., Kaufman, L. & Stewart, G. W.\n Reorthogonalization and stable algorithms for updating the\n Gram-Schmidt QR factorization. Math. Comput. 30, 772-795 (1976).\n\n .. [3] Reichel, L. & Gragg, W. B. Algorithm 686: FORTRAN Subroutines for\n Updating the QR Decomposition. ACM Trans. Math. Softw. 16"", 369-377\n (1990).\n\n Examples\n --------\n >>> import numpy as np\n >>> from scipy import linalg\n >>> a = np.array([[ 3., -2., -2.],\n ... [ 6., -9., -3.],\n ... [ -3., 10., 1.],\n ... [ 6., -7., 4.],\n ... [ 7., 8., -6.]])\n >>> q, r = linalg.qr(a)\n\n Given this q, r decomposition, perform a rank 1 update.\n\n >>> u = np.array([7., -2., 4., 3., 5.])\n >>> v = np.array([1., 3., -5.])\n >>> q_up, r_up = linalg.qr_update(q, r, u, v, False)\n >>> q_up\n array([[ 0.54073807, 0.18645997, 0.81707661, -0.02136616, 0.06902409], # may vary (signs)\n [ 0.21629523, -0.63257324, 0.06567893, 0.34125904, -0.65749222],\n [ 0.05407381, 0.64757787, -0.12781284, -0.20031219, -0.72198188],\n [ 0.48666426, -0.30466718, -0.27487277, -0.77079214, 0.0256951 ],\n [ 0.64888568, 0.23001 , -0.4859845 , 0.49883891, 0.20253783]])\n >>> r_up\n array([[ 18.49324201, 24.11691794, -44.98940746], # may vary (signs)\n [ 0. , 31.95894662, -27.40998201],\n [ 0. , 0. , -9.25451794],\n [ 0. , 0. , 0. ],\n [ 0. , 0. , 0. ]])\n\n The update is equivalent, but faster than the following.\n\n >>> a_up = a + np.outer(u, v)\n >>> q_direct, r_direct = linalg.qr(a_up)\n\n Check that we have equivalent results:\n\n >>> np.allclose(np.dot(q_up, r_up), a_up)\n True\n\n And the updated Q is still unitary:\n\n >>> np.allclose(np.dot(q_up.T, q_up), np.eye(5))\n True\n\n Updating economic (reduced, thin) decompositions is also possible:\n\n >>> qe, re = linalg.qr(a, mode='economic')\n >>> qe_up, re_up = linalg.qr_update(qe, re, u, v, False)\n >>> qe_up\n array([[ 0.54073807, 0.18645997, 0.81707661], # may vary (signs)\n [ 0.21629523, -0.63257324, 0.065678""93],\n [ 0.05407381, 0.64757787, -0.12781284],\n [ 0.48666426, -0.30466718, -0.27487277],\n [ 0.64888568, 0.23001 , -0.4859845 ]])\n >>> re_up\n array([[ 18.49324201, 24.11691794, -44.98940746], # may vary (signs)\n [ 0. , 31.95894662, -27.40998201],\n [ 0. , 0. , -9.25451794]])\n >>> np.allclose(np.dot(qe_up, re_up), a_up)\n True\n >>> np.allclose(np.dot(qe_up.T, qe_up), np.eye(3))\n True\n\n Similarly to the above, perform a rank 2 update.\n\n >>> u2 = np.array([[ 7., -1,],\n ... [-2., 4.],\n ... [ 4., 2.],\n ... [ 3., -6.],\n ... [ 5., 3.]])\n >>> v2 = np.array([[ 1., 2.],\n ... [ 3., 4.],\n ... [-5., 2]])\n >>> q_up2, r_up2 = linalg.qr_update(q, r, u2, v2, False)\n >>> q_up2\n array([[-0.33626508, -0.03477253, 0.61956287, -0.64352987, -0.29618884], # may vary (signs)\n [-0.50439762, 0.58319694, -0.43010077, -0.33395279, 0.33008064],\n [-0.21016568, -0.63123106, 0.0582249 , -0.13675572, 0.73163206],\n [ 0.12609941, 0.49694436, 0.64590024, 0.31191919, 0.47187344],\n [-0.75659643, -0.11517748, 0.10284903, 0.5986227 , -0.21299983]])\n >>> r_up2\n array([[-23.79075451, -41.1084062 , 24.71548348], # may vary (signs)\n [ 0. , -33.83931057, 11.02226551],\n [ 0. , 0. , 48.91476811],\n [ 0. , 0. , 0. ],\n [ 0. , 0. , 0. ]])\n\n This update is also a valid qr decomposition of ``A + U V**T``.\n\n >>> a_up2 = a + np.dot(u2, v2.T)\n >>> np.allclose(a_up2, np.dot(q_up2, r_up2))\n True\n >>> np.allclose(np.dot(q_up2.T, q_up2), np.eye(5))\n True\n\n ");
36647 : static PyMethodDef __pyx_mdef_5scipy_6linalg_14_decomp_update_7qr_update = {"qr_update", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6linalg_14_decomp_update_7qr_update, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6linalg_14_decomp_update_6qr_update};
36648 2376 : static PyObject *__pyx_pw_5scipy_6linalg_14_decomp_update_7qr_update(PyObject *__pyx_self,
36649 : #if CYTHON_METH_FASTCALL
36650 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
36651 : #else
36652 : PyObject *__pyx_args, PyObject *__pyx_kwds
36653 : #endif
36654 : ) {
36655 2376 : PyObject *__pyx_v_Q = 0;
36656 2376 : PyObject *__pyx_v_R = 0;
36657 2376 : PyObject *__pyx_v_u = 0;
36658 2376 : PyObject *__pyx_v_v = 0;
36659 2376 : PyObject *__pyx_v_overwrite_qruv = 0;
36660 2376 : PyObject *__pyx_v_check_finite = 0;
36661 : #if !CYTHON_METH_FASTCALL
36662 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
36663 : #endif
36664 2376 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
36665 2376 : PyObject* values[6] = {0,0,0,0,0,0};
36666 2376 : int __pyx_lineno = 0;
36667 2376 : const char *__pyx_filename = NULL;
36668 2376 : int __pyx_clineno = 0;
36669 2376 : PyObject *__pyx_r = 0;
36670 : __Pyx_RefNannyDeclarations
36671 2376 : __Pyx_RefNannySetupContext("qr_update (wrapper)", 0);
36672 : #if !CYTHON_METH_FASTCALL
36673 : #if CYTHON_ASSUME_SAFE_MACROS
36674 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
36675 : #else
36676 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
36677 : #endif
36678 : #endif
36679 2376 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
36680 : {
36681 2376 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Q,&__pyx_n_s_R,&__pyx_n_s_u,&__pyx_n_s_v,&__pyx_n_s_overwrite_qruv,&__pyx_n_s_check_finite,0};
36682 :
36683 : /* "scipy/linalg/_decomp_update.pyx":2155
36684 : *
36685 : * @cython.embedsignature(True)
36686 : * def qr_update(Q, R, u, v, overwrite_qruv=False, check_finite=True): # <<<<<<<<<<<<<<
36687 : * """
36688 : * Rank-k QR update
36689 : */
36690 2376 : values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False)));
36691 2376 : values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True)));
36692 2376 : if (__pyx_kwds) {
36693 0 : Py_ssize_t kw_args;
36694 0 : switch (__pyx_nargs) {
36695 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
36696 0 : CYTHON_FALLTHROUGH;
36697 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
36698 0 : CYTHON_FALLTHROUGH;
36699 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
36700 0 : CYTHON_FALLTHROUGH;
36701 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
36702 0 : CYTHON_FALLTHROUGH;
36703 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
36704 0 : CYTHON_FALLTHROUGH;
36705 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
36706 0 : CYTHON_FALLTHROUGH;
36707 0 : case 0: break;
36708 0 : default: goto __pyx_L5_argtuple_error;
36709 : }
36710 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
36711 0 : switch (__pyx_nargs) {
36712 0 : case 0:
36713 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_Q)) != 0)) {
36714 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
36715 0 : kw_args--;
36716 : }
36717 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
36718 0 : else goto __pyx_L5_argtuple_error;
36719 0 : CYTHON_FALLTHROUGH;
36720 : case 1:
36721 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) {
36722 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
36723 0 : kw_args--;
36724 : }
36725 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
36726 : else {
36727 0 : __Pyx_RaiseArgtupleInvalid("qr_update", 0, 4, 6, 1); __PYX_ERR(0, 2154, __pyx_L3_error)
36728 : }
36729 0 : CYTHON_FALLTHROUGH;
36730 : case 2:
36731 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) {
36732 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
36733 0 : kw_args--;
36734 : }
36735 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
36736 : else {
36737 0 : __Pyx_RaiseArgtupleInvalid("qr_update", 0, 4, 6, 2); __PYX_ERR(0, 2154, __pyx_L3_error)
36738 : }
36739 0 : CYTHON_FALLTHROUGH;
36740 : case 3:
36741 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) {
36742 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
36743 0 : kw_args--;
36744 : }
36745 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
36746 : else {
36747 0 : __Pyx_RaiseArgtupleInvalid("qr_update", 0, 4, 6, 3); __PYX_ERR(0, 2154, __pyx_L3_error)
36748 : }
36749 0 : CYTHON_FALLTHROUGH;
36750 : case 4:
36751 0 : if (kw_args > 0) {
36752 0 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_overwrite_qruv);
36753 0 : if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
36754 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
36755 : }
36756 0 : CYTHON_FALLTHROUGH;
36757 : case 5:
36758 0 : if (kw_args > 0) {
36759 0 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_check_finite);
36760 0 : if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
36761 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L3_error)
36762 : }
36763 : }
36764 0 : if (unlikely(kw_args > 0)) {
36765 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
36766 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "qr_update") < 0)) __PYX_ERR(0, 2154, __pyx_L3_error)
36767 : }
36768 : } else {
36769 2376 : switch (__pyx_nargs) {
36770 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
36771 2064 : CYTHON_FALLTHROUGH;
36772 2064 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
36773 2376 : CYTHON_FALLTHROUGH;
36774 2376 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
36775 2376 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
36776 2376 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
36777 2376 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
36778 2376 : break;
36779 0 : default: goto __pyx_L5_argtuple_error;
36780 : }
36781 : }
36782 2376 : __pyx_v_Q = values[0];
36783 2376 : __pyx_v_R = values[1];
36784 2376 : __pyx_v_u = values[2];
36785 2376 : __pyx_v_v = values[3];
36786 2376 : __pyx_v_overwrite_qruv = values[4];
36787 2376 : __pyx_v_check_finite = values[5];
36788 : }
36789 2376 : goto __pyx_L6_skip;
36790 0 : __pyx_L5_argtuple_error:;
36791 0 : __Pyx_RaiseArgtupleInvalid("qr_update", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 2154, __pyx_L3_error)
36792 2376 : __pyx_L6_skip:;
36793 2376 : goto __pyx_L4_argument_unpacking_done;
36794 0 : __pyx_L3_error:;
36795 : {
36796 0 : Py_ssize_t __pyx_temp;
36797 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
36798 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
36799 : }
36800 : }
36801 0 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
36802 0 : __Pyx_RefNannyFinishContext();
36803 0 : return NULL;
36804 2376 : __pyx_L4_argument_unpacking_done:;
36805 2376 : __pyx_r = __pyx_pf_5scipy_6linalg_14_decomp_update_6qr_update(__pyx_self, __pyx_v_Q, __pyx_v_R, __pyx_v_u, __pyx_v_v, __pyx_v_overwrite_qruv, __pyx_v_check_finite);
36806 :
36807 : /* "scipy/linalg/_decomp_update.pyx":2154
36808 : * return q1, rnew
36809 : *
36810 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
36811 : * def qr_update(Q, R, u, v, overwrite_qruv=False, check_finite=True):
36812 : * """
36813 : */
36814 :
36815 : /* function exit code */
36816 : {
36817 2376 : Py_ssize_t __pyx_temp;
36818 2376 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
36819 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
36820 : }
36821 : }
36822 : __Pyx_RefNannyFinishContext();
36823 : return __pyx_r;
36824 : }
36825 :
36826 2376 : static PyObject *__pyx_pf_5scipy_6linalg_14_decomp_update_6qr_update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Q, PyObject *__pyx_v_R, PyObject *__pyx_v_u, PyObject *__pyx_v_v, PyObject *__pyx_v_overwrite_qruv, PyObject *__pyx_v_check_finite) {
36827 2376 : PyArrayObject *__pyx_v_q1 = 0;
36828 2376 : PyArrayObject *__pyx_v_r1 = 0;
36829 2376 : PyArrayObject *__pyx_v_u1 = 0;
36830 2376 : PyArrayObject *__pyx_v_v1 = 0;
36831 2376 : PyArrayObject *__pyx_v_qTu = 0;
36832 2376 : PyArrayObject *__pyx_v_s = 0;
36833 2376 : int __pyx_v_uv_flags;
36834 2376 : int __pyx_v_typecode;
36835 2376 : int __pyx_v_p;
36836 2376 : int __pyx_v_m;
36837 2376 : int __pyx_v_n;
36838 2376 : int __pyx_v_info;
36839 2376 : void *__pyx_v_qptr;
36840 2376 : void *__pyx_v_rptr;
36841 2376 : void *__pyx_v_uptr;
36842 2376 : void *__pyx_v_vptr;
36843 2376 : void *__pyx_v_sptr;
36844 2376 : void *__pyx_v_qTuptr;
36845 2376 : int __pyx_v_qs[2];
36846 2376 : int __pyx_v_rs[2];
36847 2376 : int __pyx_v_qTus[2];
36848 2376 : int __pyx_v_us[2];
36849 2376 : int __pyx_v_vs[2];
36850 2376 : int __pyx_v_ss[2];
36851 2376 : int __pyx_v_economic;
36852 2376 : int __pyx_v_qisF;
36853 2376 : int __pyx_v_chkfinite;
36854 2376 : int __pyx_v_overwrite;
36855 2376 : npy_intp __pyx_v_ndim;
36856 2376 : npy_intp __pyx_v_length;
36857 2376 : PyObject *__pyx_v_rnew = NULL;
36858 2376 : PyObject *__pyx_r = NULL;
36859 : __Pyx_RefNannyDeclarations
36860 2376 : int __pyx_t_1;
36861 2376 : PyObject *__pyx_t_2 = NULL;
36862 2376 : PyObject *__pyx_t_3 = NULL;
36863 2376 : PyObject *__pyx_t_4 = NULL;
36864 2376 : PyObject *__pyx_t_5 = NULL;
36865 2376 : PyObject *__pyx_t_6 = NULL;
36866 2376 : PyObject *__pyx_t_7 = NULL;
36867 2376 : PyObject *__pyx_t_8 = NULL;
36868 2376 : int __pyx_t_9;
36869 2376 : int __pyx_t_10;
36870 2376 : int __pyx_t_11;
36871 2376 : int __pyx_t_12;
36872 2376 : unsigned int __pyx_t_13;
36873 2376 : int __pyx_lineno = 0;
36874 2376 : const char *__pyx_filename = NULL;
36875 2376 : int __pyx_clineno = 0;
36876 2376 : __Pyx_RefNannySetupContext("qr_update", 1);
36877 :
36878 : /* "scipy/linalg/_decomp_update.pyx":2310
36879 : * """
36880 : * cdef cnp.ndarray q1, r1, u1, v1, qTu, s
36881 : * cdef int uv_flags = cnp.NPY_ARRAY_BEHAVED_NS | cnp.NPY_ARRAY_ELEMENTSTRIDES # <<<<<<<<<<<<<<
36882 : * cdef int typecode, p, m, n, info
36883 : * cdef void* qptr
36884 : */
36885 2376 : __pyx_v_uv_flags = (NPY_ARRAY_BEHAVED_NS | NPY_ARRAY_ELEMENTSTRIDES);
36886 :
36887 : /* "scipy/linalg/_decomp_update.pyx":2324
36888 : * cdef int vs[2]
36889 : * cdef int ss[2]
36890 : * cdef bint economic, qisF = False # <<<<<<<<<<<<<<
36891 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qruv
36892 : * cdef cnp.npy_intp ndim, length
36893 : */
36894 2376 : __pyx_v_qisF = 0;
36895 :
36896 : /* "scipy/linalg/_decomp_update.pyx":2325
36897 : * cdef int ss[2]
36898 : * cdef bint economic, qisF = False
36899 : * cdef bint chkfinite = check_finite, overwrite = overwrite_qruv # <<<<<<<<<<<<<<
36900 : * cdef cnp.npy_intp ndim, length
36901 : *
36902 : */
36903 2376 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_check_finite); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2325, __pyx_L1_error)
36904 2376 : __pyx_v_chkfinite = __pyx_t_1;
36905 2376 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_overwrite_qruv); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2325, __pyx_L1_error)
36906 2376 : __pyx_v_overwrite = __pyx_t_1;
36907 :
36908 : /* "scipy/linalg/_decomp_update.pyx":2330
36909 : * # Rather than overspecify our order requirements on Q and R, let anything
36910 : * # through then adjust.
36911 : * q1, r1, typecode, m, n, economic = validate_qr(Q, R, overwrite, ARRAY_ANYORDER, # <<<<<<<<<<<<<<
36912 : * overwrite, ARRAY_ANYORDER, chkfinite)
36913 : *
36914 : */
36915 2376 : __pyx_t_2 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_qr(__pyx_v_Q, __pyx_v_R, __pyx_v_overwrite, 0, __pyx_v_overwrite, 0, __pyx_v_chkfinite); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error)
36916 2220 : __Pyx_GOTREF(__pyx_t_2);
36917 2220 : if (likely(__pyx_t_2 != Py_None)) {
36918 2220 : PyObject* sequence = __pyx_t_2;
36919 2220 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36920 2220 : if (unlikely(size != 6)) {
36921 0 : if (size > 6) __Pyx_RaiseTooManyValuesError(6);
36922 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
36923 0 : __PYX_ERR(0, 2330, __pyx_L1_error)
36924 : }
36925 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36926 2220 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
36927 2220 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
36928 2220 : __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
36929 2220 : __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
36930 2220 : __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
36931 2220 : __pyx_t_8 = PyTuple_GET_ITEM(sequence, 5);
36932 2220 : __Pyx_INCREF(__pyx_t_3);
36933 2220 : __Pyx_INCREF(__pyx_t_4);
36934 2220 : __Pyx_INCREF(__pyx_t_5);
36935 2220 : __Pyx_INCREF(__pyx_t_6);
36936 2220 : __Pyx_INCREF(__pyx_t_7);
36937 2220 : __Pyx_INCREF(__pyx_t_8);
36938 : #else
36939 : {
36940 : Py_ssize_t i;
36941 : PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
36942 : for (i=0; i < 6; i++) {
36943 : PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2330, __pyx_L1_error)
36944 : __Pyx_GOTREF(item);
36945 : *(temps[i]) = item;
36946 : }
36947 : }
36948 : #endif
36949 2220 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36950 : } else {
36951 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 2330, __pyx_L1_error)
36952 : }
36953 2220 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2330, __pyx_L1_error)
36954 2220 : if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2330, __pyx_L1_error)
36955 2220 : __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error)
36956 2220 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36957 2220 : __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error)
36958 2220 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36959 2220 : __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error)
36960 2220 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
36961 2220 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2330, __pyx_L1_error)
36962 2220 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36963 2220 : __pyx_v_q1 = ((PyArrayObject *)__pyx_t_3);
36964 2220 : __pyx_t_3 = 0;
36965 2220 : __pyx_v_r1 = ((PyArrayObject *)__pyx_t_4);
36966 2220 : __pyx_t_4 = 0;
36967 2220 : __pyx_v_typecode = __pyx_t_9;
36968 2220 : __pyx_v_m = __pyx_t_10;
36969 2220 : __pyx_v_n = __pyx_t_11;
36970 2220 : __pyx_v_economic = __pyx_t_1;
36971 :
36972 : /* "scipy/linalg/_decomp_update.pyx":2333
36973 : * overwrite, ARRAY_ANYORDER, chkfinite)
36974 : *
36975 : * if not overwrite: # <<<<<<<<<<<<<<
36976 : * uv_flags |= cnp.NPY_ARRAY_ENSURECOPY
36977 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, uv_flags, NULL)
36978 : */
36979 2220 : __pyx_t_1 = (!__pyx_v_overwrite);
36980 2220 : if (__pyx_t_1) {
36981 :
36982 : /* "scipy/linalg/_decomp_update.pyx":2334
36983 : *
36984 : * if not overwrite:
36985 : * uv_flags |= cnp.NPY_ARRAY_ENSURECOPY # <<<<<<<<<<<<<<
36986 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, uv_flags, NULL)
36987 : * v1 = PyArray_CheckFromAny(v, NULL, 0, 0, uv_flags, NULL)
36988 : */
36989 1240 : __pyx_v_uv_flags = (__pyx_v_uv_flags | NPY_ARRAY_ENSURECOPY);
36990 :
36991 : /* "scipy/linalg/_decomp_update.pyx":2333
36992 : * overwrite, ARRAY_ANYORDER, chkfinite)
36993 : *
36994 : * if not overwrite: # <<<<<<<<<<<<<<
36995 : * uv_flags |= cnp.NPY_ARRAY_ENSURECOPY
36996 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, uv_flags, NULL)
36997 : */
36998 : }
36999 :
37000 : /* "scipy/linalg/_decomp_update.pyx":2335
37001 : * if not overwrite:
37002 : * uv_flags |= cnp.NPY_ARRAY_ENSURECOPY
37003 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, uv_flags, NULL) # <<<<<<<<<<<<<<
37004 : * v1 = PyArray_CheckFromAny(v, NULL, 0, 0, uv_flags, NULL)
37005 : *
37006 : */
37007 2220 : __pyx_t_2 = ((PyObject *)PyArray_CheckFromAny(__pyx_v_u, NULL, 0, 0, __pyx_v_uv_flags, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2335, __pyx_L1_error)
37008 2220 : __Pyx_GOTREF(__pyx_t_2);
37009 2220 : __pyx_v_u1 = ((PyArrayObject *)__pyx_t_2);
37010 2220 : __pyx_t_2 = 0;
37011 :
37012 : /* "scipy/linalg/_decomp_update.pyx":2336
37013 : * uv_flags |= cnp.NPY_ARRAY_ENSURECOPY
37014 : * u1 = PyArray_CheckFromAny(u, NULL, 0, 0, uv_flags, NULL)
37015 : * v1 = PyArray_CheckFromAny(v, NULL, 0, 0, uv_flags, NULL) # <<<<<<<<<<<<<<
37016 : *
37017 : * if cnp.PyArray_TYPE(u1) != typecode or cnp.PyArray_TYPE(v1) != typecode:
37018 : */
37019 2220 : __pyx_t_2 = ((PyObject *)PyArray_CheckFromAny(__pyx_v_v, NULL, 0, 0, __pyx_v_uv_flags, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2336, __pyx_L1_error)
37020 2220 : __Pyx_GOTREF(__pyx_t_2);
37021 2220 : __pyx_v_v1 = ((PyArrayObject *)__pyx_t_2);
37022 2220 : __pyx_t_2 = 0;
37023 :
37024 : /* "scipy/linalg/_decomp_update.pyx":2338
37025 : * v1 = PyArray_CheckFromAny(v, NULL, 0, 0, uv_flags, NULL)
37026 : *
37027 : * if cnp.PyArray_TYPE(u1) != typecode or cnp.PyArray_TYPE(v1) != typecode: # <<<<<<<<<<<<<<
37028 : * raise ValueError('u and v must have the same type as Q and R')
37029 : *
37030 : */
37031 2220 : __pyx_t_12 = (PyArray_TYPE(__pyx_v_u1) != __pyx_v_typecode);
37032 2220 : if (!__pyx_t_12) {
37033 2169 : } else {
37034 51 : __pyx_t_1 = __pyx_t_12;
37035 51 : goto __pyx_L5_bool_binop_done;
37036 : }
37037 2169 : __pyx_t_12 = (PyArray_TYPE(__pyx_v_v1) != __pyx_v_typecode);
37038 2169 : __pyx_t_1 = __pyx_t_12;
37039 2220 : __pyx_L5_bool_binop_done:;
37040 2220 : if (unlikely(__pyx_t_1)) {
37041 :
37042 : /* "scipy/linalg/_decomp_update.pyx":2339
37043 : *
37044 : * if cnp.PyArray_TYPE(u1) != typecode or cnp.PyArray_TYPE(v1) != typecode:
37045 : * raise ValueError('u and v must have the same type as Q and R') # <<<<<<<<<<<<<<
37046 : *
37047 : * if u1.ndim < 1 or u1.ndim > 2:
37048 : */
37049 102 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2339, __pyx_L1_error)
37050 102 : __Pyx_GOTREF(__pyx_t_2);
37051 102 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37052 102 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37053 102 : __PYX_ERR(0, 2339, __pyx_L1_error)
37054 :
37055 : /* "scipy/linalg/_decomp_update.pyx":2338
37056 : * v1 = PyArray_CheckFromAny(v, NULL, 0, 0, uv_flags, NULL)
37057 : *
37058 : * if cnp.PyArray_TYPE(u1) != typecode or cnp.PyArray_TYPE(v1) != typecode: # <<<<<<<<<<<<<<
37059 : * raise ValueError('u and v must have the same type as Q and R')
37060 : *
37061 : */
37062 : }
37063 :
37064 : /* "scipy/linalg/_decomp_update.pyx":2341
37065 : * raise ValueError('u and v must have the same type as Q and R')
37066 : *
37067 : * if u1.ndim < 1 or u1.ndim > 2: # <<<<<<<<<<<<<<
37068 : * raise ValueError('u must be either 1- or 2-D.')
37069 : *
37070 : */
37071 2118 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) < 1);
37072 2118 : if (!__pyx_t_12) {
37073 2114 : } else {
37074 4 : __pyx_t_1 = __pyx_t_12;
37075 4 : goto __pyx_L8_bool_binop_done;
37076 : }
37077 2114 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) > 2);
37078 2114 : __pyx_t_1 = __pyx_t_12;
37079 2118 : __pyx_L8_bool_binop_done:;
37080 2118 : if (unlikely(__pyx_t_1)) {
37081 :
37082 : /* "scipy/linalg/_decomp_update.pyx":2342
37083 : *
37084 : * if u1.ndim < 1 or u1.ndim > 2:
37085 : * raise ValueError('u must be either 1- or 2-D.') # <<<<<<<<<<<<<<
37086 : *
37087 : * if v1.ndim < 1 or v1.ndim > 2:
37088 : */
37089 4 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2342, __pyx_L1_error)
37090 4 : __Pyx_GOTREF(__pyx_t_2);
37091 4 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37092 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37093 4 : __PYX_ERR(0, 2342, __pyx_L1_error)
37094 :
37095 : /* "scipy/linalg/_decomp_update.pyx":2341
37096 : * raise ValueError('u and v must have the same type as Q and R')
37097 : *
37098 : * if u1.ndim < 1 or u1.ndim > 2: # <<<<<<<<<<<<<<
37099 : * raise ValueError('u must be either 1- or 2-D.')
37100 : *
37101 : */
37102 : }
37103 :
37104 : /* "scipy/linalg/_decomp_update.pyx":2344
37105 : * raise ValueError('u must be either 1- or 2-D.')
37106 : *
37107 : * if v1.ndim < 1 or v1.ndim > 2: # <<<<<<<<<<<<<<
37108 : * raise ValueError('v must be either 1- or 2-D.')
37109 : *
37110 : */
37111 2114 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_v1) < 1);
37112 2114 : if (!__pyx_t_12) {
37113 2110 : } else {
37114 4 : __pyx_t_1 = __pyx_t_12;
37115 4 : goto __pyx_L11_bool_binop_done;
37116 : }
37117 2110 : __pyx_t_12 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_v1) > 2);
37118 2110 : __pyx_t_1 = __pyx_t_12;
37119 2114 : __pyx_L11_bool_binop_done:;
37120 2114 : if (unlikely(__pyx_t_1)) {
37121 :
37122 : /* "scipy/linalg/_decomp_update.pyx":2345
37123 : *
37124 : * if v1.ndim < 1 or v1.ndim > 2:
37125 : * raise ValueError('v must be either 1- or 2-D.') # <<<<<<<<<<<<<<
37126 : *
37127 : * if u1.shape[0] != m:
37128 : */
37129 4 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2345, __pyx_L1_error)
37130 4 : __Pyx_GOTREF(__pyx_t_2);
37131 4 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37132 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37133 4 : __PYX_ERR(0, 2345, __pyx_L1_error)
37134 :
37135 : /* "scipy/linalg/_decomp_update.pyx":2344
37136 : * raise ValueError('u must be either 1- or 2-D.')
37137 : *
37138 : * if v1.ndim < 1 or v1.ndim > 2: # <<<<<<<<<<<<<<
37139 : * raise ValueError('v must be either 1- or 2-D.')
37140 : *
37141 : */
37142 : }
37143 :
37144 : /* "scipy/linalg/_decomp_update.pyx":2347
37145 : * raise ValueError('v must be either 1- or 2-D.')
37146 : *
37147 : * if u1.shape[0] != m: # <<<<<<<<<<<<<<
37148 : * raise ValueError('u.shape[0] must equal Q.shape[0]')
37149 : *
37150 : */
37151 2110 : __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[0]) != __pyx_v_m);
37152 2110 : if (unlikely(__pyx_t_1)) {
37153 :
37154 : /* "scipy/linalg/_decomp_update.pyx":2348
37155 : *
37156 : * if u1.shape[0] != m:
37157 : * raise ValueError('u.shape[0] must equal Q.shape[0]') # <<<<<<<<<<<<<<
37158 : *
37159 : * if v1.shape[0] != n:
37160 : */
37161 5 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2348, __pyx_L1_error)
37162 5 : __Pyx_GOTREF(__pyx_t_2);
37163 5 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37164 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37165 5 : __PYX_ERR(0, 2348, __pyx_L1_error)
37166 :
37167 : /* "scipy/linalg/_decomp_update.pyx":2347
37168 : * raise ValueError('v must be either 1- or 2-D.')
37169 : *
37170 : * if u1.shape[0] != m: # <<<<<<<<<<<<<<
37171 : * raise ValueError('u.shape[0] must equal Q.shape[0]')
37172 : *
37173 : */
37174 : }
37175 :
37176 : /* "scipy/linalg/_decomp_update.pyx":2350
37177 : * raise ValueError('u.shape[0] must equal Q.shape[0]')
37178 : *
37179 : * if v1.shape[0] != n: # <<<<<<<<<<<<<<
37180 : * raise ValueError('v.shape[0] must equal R.shape[1]')
37181 : *
37182 : */
37183 2105 : __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_v1)[0]) != __pyx_v_n);
37184 2105 : if (unlikely(__pyx_t_1)) {
37185 :
37186 : /* "scipy/linalg/_decomp_update.pyx":2351
37187 : *
37188 : * if v1.shape[0] != n:
37189 : * raise ValueError('v.shape[0] must equal R.shape[1]') # <<<<<<<<<<<<<<
37190 : *
37191 : * if u1.ndim != v1.ndim:
37192 : */
37193 5 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2351, __pyx_L1_error)
37194 5 : __Pyx_GOTREF(__pyx_t_2);
37195 5 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37196 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37197 5 : __PYX_ERR(0, 2351, __pyx_L1_error)
37198 :
37199 : /* "scipy/linalg/_decomp_update.pyx":2350
37200 : * raise ValueError('u.shape[0] must equal Q.shape[0]')
37201 : *
37202 : * if v1.shape[0] != n: # <<<<<<<<<<<<<<
37203 : * raise ValueError('v.shape[0] must equal R.shape[1]')
37204 : *
37205 : */
37206 : }
37207 :
37208 : /* "scipy/linalg/_decomp_update.pyx":2353
37209 : * raise ValueError('v.shape[0] must equal R.shape[1]')
37210 : *
37211 : * if u1.ndim != v1.ndim: # <<<<<<<<<<<<<<
37212 : * raise ValueError('u and v must have the same number of dimensions')
37213 : *
37214 : */
37215 2100 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) != __pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_v1));
37216 2100 : if (unlikely(__pyx_t_1)) {
37217 :
37218 : /* "scipy/linalg/_decomp_update.pyx":2354
37219 : *
37220 : * if u1.ndim != v1.ndim:
37221 : * raise ValueError('u and v must have the same number of dimensions') # <<<<<<<<<<<<<<
37222 : *
37223 : * if u1.ndim == 2:
37224 : */
37225 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error)
37226 0 : __Pyx_GOTREF(__pyx_t_2);
37227 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37228 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37229 0 : __PYX_ERR(0, 2354, __pyx_L1_error)
37230 :
37231 : /* "scipy/linalg/_decomp_update.pyx":2353
37232 : * raise ValueError('v.shape[0] must equal R.shape[1]')
37233 : *
37234 : * if u1.ndim != v1.ndim: # <<<<<<<<<<<<<<
37235 : * raise ValueError('u and v must have the same number of dimensions')
37236 : *
37237 : */
37238 : }
37239 :
37240 : /* "scipy/linalg/_decomp_update.pyx":2356
37241 : * raise ValueError('u and v must have the same number of dimensions')
37242 : *
37243 : * if u1.ndim == 2: # <<<<<<<<<<<<<<
37244 : * if u1.shape[1] != v1.shape[1]:
37245 : * raise ValueError('Second dimension of u and v must be the same')
37246 : */
37247 2100 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) == 2);
37248 2100 : if (__pyx_t_1) {
37249 :
37250 : /* "scipy/linalg/_decomp_update.pyx":2357
37251 : *
37252 : * if u1.ndim == 2:
37253 : * if u1.shape[1] != v1.shape[1]: # <<<<<<<<<<<<<<
37254 : * raise ValueError('Second dimension of u and v must be the same')
37255 : * elif u1.shape[1] == 1:
37256 : */
37257 1064 : __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[1]) != (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_v1)[1]));
37258 1064 : if (unlikely(__pyx_t_1)) {
37259 :
37260 : /* "scipy/linalg/_decomp_update.pyx":2358
37261 : * if u1.ndim == 2:
37262 : * if u1.shape[1] != v1.shape[1]:
37263 : * raise ValueError('Second dimension of u and v must be the same') # <<<<<<<<<<<<<<
37264 : * elif u1.shape[1] == 1:
37265 : * u1 = u1[:,0]
37266 : */
37267 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2358, __pyx_L1_error)
37268 0 : __Pyx_GOTREF(__pyx_t_2);
37269 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37270 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37271 0 : __PYX_ERR(0, 2358, __pyx_L1_error)
37272 :
37273 : /* "scipy/linalg/_decomp_update.pyx":2357
37274 : *
37275 : * if u1.ndim == 2:
37276 : * if u1.shape[1] != v1.shape[1]: # <<<<<<<<<<<<<<
37277 : * raise ValueError('Second dimension of u and v must be the same')
37278 : * elif u1.shape[1] == 1:
37279 : */
37280 : }
37281 :
37282 : /* "scipy/linalg/_decomp_update.pyx":2359
37283 : * if u1.shape[1] != v1.shape[1]:
37284 : * raise ValueError('Second dimension of u and v must be the same')
37285 : * elif u1.shape[1] == 1: # <<<<<<<<<<<<<<
37286 : * u1 = u1[:,0]
37287 : * v1 = v1[:,0]
37288 : */
37289 1064 : __pyx_t_1 = ((__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[1]) == 1);
37290 1064 : if (__pyx_t_1) {
37291 :
37292 : /* "scipy/linalg/_decomp_update.pyx":2360
37293 : * raise ValueError('Second dimension of u and v must be the same')
37294 : * elif u1.shape[1] == 1:
37295 : * u1 = u1[:,0] # <<<<<<<<<<<<<<
37296 : * v1 = v1[:,0]
37297 : *
37298 : */
37299 32 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_u1), __pyx_tuple__33); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2360, __pyx_L1_error)
37300 32 : __Pyx_GOTREF(__pyx_t_2);
37301 32 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2360, __pyx_L1_error)
37302 32 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_2));
37303 32 : __pyx_t_2 = 0;
37304 :
37305 : /* "scipy/linalg/_decomp_update.pyx":2361
37306 : * elif u1.shape[1] == 1:
37307 : * u1 = u1[:,0]
37308 : * v1 = v1[:,0] # <<<<<<<<<<<<<<
37309 : *
37310 : * if u1.ndim == 1:
37311 : */
37312 32 : __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v1), __pyx_tuple__33); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2361, __pyx_L1_error)
37313 32 : __Pyx_GOTREF(__pyx_t_2);
37314 32 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2361, __pyx_L1_error)
37315 32 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_2));
37316 2100 : __pyx_t_2 = 0;
37317 :
37318 : /* "scipy/linalg/_decomp_update.pyx":2359
37319 : * if u1.shape[1] != v1.shape[1]:
37320 : * raise ValueError('Second dimension of u and v must be the same')
37321 : * elif u1.shape[1] == 1: # <<<<<<<<<<<<<<
37322 : * u1 = u1[:,0]
37323 : * v1 = v1[:,0]
37324 : */
37325 : }
37326 :
37327 : /* "scipy/linalg/_decomp_update.pyx":2356
37328 : * raise ValueError('u and v must have the same number of dimensions')
37329 : *
37330 : * if u1.ndim == 2: # <<<<<<<<<<<<<<
37331 : * if u1.shape[1] != v1.shape[1]:
37332 : * raise ValueError('Second dimension of u and v must be the same')
37333 : */
37334 : }
37335 :
37336 : /* "scipy/linalg/_decomp_update.pyx":2363
37337 : * v1 = v1[:,0]
37338 : *
37339 : * if u1.ndim == 1: # <<<<<<<<<<<<<<
37340 : * p = 1
37341 : * else:
37342 : */
37343 2100 : __pyx_t_1 = (__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1) == 1);
37344 2100 : if (__pyx_t_1) {
37345 :
37346 : /* "scipy/linalg/_decomp_update.pyx":2364
37347 : *
37348 : * if u1.ndim == 1:
37349 : * p = 1 # <<<<<<<<<<<<<<
37350 : * else:
37351 : * p = u1.shape[1]
37352 : */
37353 1068 : __pyx_v_p = 1;
37354 :
37355 : /* "scipy/linalg/_decomp_update.pyx":2363
37356 : * v1 = v1[:,0]
37357 : *
37358 : * if u1.ndim == 1: # <<<<<<<<<<<<<<
37359 : * p = 1
37360 : * else:
37361 : */
37362 1068 : goto __pyx_L18;
37363 : }
37364 :
37365 : /* "scipy/linalg/_decomp_update.pyx":2366
37366 : * p = 1
37367 : * else:
37368 : * p = u1.shape[1] # <<<<<<<<<<<<<<
37369 : *
37370 : * # limit p to at most max(n, m)
37371 : */
37372 : /*else*/ {
37373 1032 : __pyx_v_p = (__pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1)[1]);
37374 : }
37375 2100 : __pyx_L18:;
37376 :
37377 : /* "scipy/linalg/_decomp_update.pyx":2369
37378 : *
37379 : * # limit p to at most max(n, m)
37380 : * if p > n or p > m: # <<<<<<<<<<<<<<
37381 : * raise ValueError('Update rank larger than np.dot(Q, R).')
37382 : *
37383 : */
37384 2100 : __pyx_t_12 = (__pyx_v_p > __pyx_v_n);
37385 2100 : if (!__pyx_t_12) {
37386 2100 : } else {
37387 0 : __pyx_t_1 = __pyx_t_12;
37388 0 : goto __pyx_L20_bool_binop_done;
37389 : }
37390 2100 : __pyx_t_12 = (__pyx_v_p > __pyx_v_m);
37391 2100 : __pyx_t_1 = __pyx_t_12;
37392 2100 : __pyx_L20_bool_binop_done:;
37393 2100 : if (unlikely(__pyx_t_1)) {
37394 :
37395 : /* "scipy/linalg/_decomp_update.pyx":2370
37396 : * # limit p to at most max(n, m)
37397 : * if p > n or p > m:
37398 : * raise ValueError('Update rank larger than np.dot(Q, R).') # <<<<<<<<<<<<<<
37399 : *
37400 : * u1 = validate_array(u1, chkfinite)
37401 : */
37402 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2370, __pyx_L1_error)
37403 0 : __Pyx_GOTREF(__pyx_t_2);
37404 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
37405 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37406 0 : __PYX_ERR(0, 2370, __pyx_L1_error)
37407 :
37408 : /* "scipy/linalg/_decomp_update.pyx":2369
37409 : *
37410 : * # limit p to at most max(n, m)
37411 : * if p > n or p > m: # <<<<<<<<<<<<<<
37412 : * raise ValueError('Update rank larger than np.dot(Q, R).')
37413 : *
37414 : */
37415 : }
37416 :
37417 : /* "scipy/linalg/_decomp_update.pyx":2372
37418 : * raise ValueError('Update rank larger than np.dot(Q, R).')
37419 : *
37420 : * u1 = validate_array(u1, chkfinite) # <<<<<<<<<<<<<<
37421 : * v1 = validate_array(v1, chkfinite)
37422 : *
37423 : */
37424 2100 : __pyx_t_2 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_u1, __pyx_v_chkfinite); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2372, __pyx_L1_error)
37425 2068 : __Pyx_GOTREF(__pyx_t_2);
37426 2068 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2372, __pyx_L1_error)
37427 2068 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_2));
37428 2068 : __pyx_t_2 = 0;
37429 :
37430 : /* "scipy/linalg/_decomp_update.pyx":2373
37431 : *
37432 : * u1 = validate_array(u1, chkfinite)
37433 : * v1 = validate_array(v1, chkfinite) # <<<<<<<<<<<<<<
37434 : *
37435 : * # special case 1xN
37436 : */
37437 2068 : __pyx_t_2 = __pyx_f_5scipy_6linalg_14_decomp_update_validate_array(__pyx_v_v1, __pyx_v_chkfinite); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2373, __pyx_L1_error)
37438 2068 : __Pyx_GOTREF(__pyx_t_2);
37439 2068 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2373, __pyx_L1_error)
37440 2068 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_2));
37441 2068 : __pyx_t_2 = 0;
37442 :
37443 : /* "scipy/linalg/_decomp_update.pyx":2379
37444 : * # we only need consider rank 1 updates, since we have
37445 : * # limited p to max(m,n) above.
37446 : * if m == 1: # <<<<<<<<<<<<<<
37447 : * rnew = r1 + q1.conjugate()*u1.ravel()*v1.conjugate().ravel()
37448 : * return q1.copy(), rnew
37449 : */
37450 2068 : __pyx_t_1 = (__pyx_v_m == 1);
37451 2068 : if (__pyx_t_1) {
37452 :
37453 : /* "scipy/linalg/_decomp_update.pyx":2380
37454 : * # limited p to max(m,n) above.
37455 : * if m == 1:
37456 : * rnew = r1 + q1.conjugate()*u1.ravel()*v1.conjugate().ravel() # <<<<<<<<<<<<<<
37457 : * return q1.copy(), rnew
37458 : *
37459 : */
37460 16 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_q1), __pyx_n_s_conjugate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2380, __pyx_L1_error)
37461 16 : __Pyx_GOTREF(__pyx_t_8);
37462 16 : __pyx_t_7 = NULL;
37463 16 : __pyx_t_13 = 0;
37464 : #if CYTHON_UNPACK_METHODS
37465 16 : if (likely(PyMethod_Check(__pyx_t_8))) {
37466 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
37467 0 : if (likely(__pyx_t_7)) {
37468 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
37469 0 : __Pyx_INCREF(__pyx_t_7);
37470 0 : __Pyx_INCREF(function);
37471 0 : __Pyx_DECREF_SET(__pyx_t_8, function);
37472 : __pyx_t_13 = 1;
37473 : }
37474 : }
37475 : #endif
37476 : {
37477 16 : PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
37478 16 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
37479 16 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
37480 16 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error)
37481 16 : __Pyx_GOTREF(__pyx_t_2);
37482 16 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37483 : }
37484 16 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_u1), __pyx_n_s_ravel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2380, __pyx_L1_error)
37485 16 : __Pyx_GOTREF(__pyx_t_7);
37486 16 : __pyx_t_6 = NULL;
37487 16 : __pyx_t_13 = 0;
37488 : #if CYTHON_UNPACK_METHODS
37489 16 : if (likely(PyMethod_Check(__pyx_t_7))) {
37490 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
37491 0 : if (likely(__pyx_t_6)) {
37492 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
37493 0 : __Pyx_INCREF(__pyx_t_6);
37494 0 : __Pyx_INCREF(function);
37495 0 : __Pyx_DECREF_SET(__pyx_t_7, function);
37496 : __pyx_t_13 = 1;
37497 : }
37498 : }
37499 : #endif
37500 : {
37501 16 : PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
37502 16 : __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
37503 16 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
37504 16 : if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2380, __pyx_L1_error)
37505 16 : __Pyx_GOTREF(__pyx_t_8);
37506 16 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
37507 : }
37508 16 : __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2380, __pyx_L1_error)
37509 16 : __Pyx_GOTREF(__pyx_t_7);
37510 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37511 16 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37512 16 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_v1), __pyx_n_s_conjugate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __pyx_L1_error)
37513 16 : __Pyx_GOTREF(__pyx_t_6);
37514 16 : __pyx_t_5 = NULL;
37515 16 : __pyx_t_13 = 0;
37516 : #if CYTHON_UNPACK_METHODS
37517 16 : if (likely(PyMethod_Check(__pyx_t_6))) {
37518 0 : __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
37519 0 : if (likely(__pyx_t_5)) {
37520 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
37521 0 : __Pyx_INCREF(__pyx_t_5);
37522 0 : __Pyx_INCREF(function);
37523 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
37524 : __pyx_t_13 = 1;
37525 : }
37526 : }
37527 : #endif
37528 : {
37529 16 : PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
37530 16 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
37531 16 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
37532 16 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error)
37533 16 : __Pyx_GOTREF(__pyx_t_2);
37534 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37535 : }
37536 16 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __pyx_L1_error)
37537 16 : __Pyx_GOTREF(__pyx_t_6);
37538 16 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37539 16 : __pyx_t_2 = NULL;
37540 16 : __pyx_t_13 = 0;
37541 : #if CYTHON_UNPACK_METHODS
37542 16 : if (likely(PyMethod_Check(__pyx_t_6))) {
37543 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
37544 0 : if (likely(__pyx_t_2)) {
37545 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
37546 0 : __Pyx_INCREF(__pyx_t_2);
37547 0 : __Pyx_INCREF(function);
37548 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
37549 : __pyx_t_13 = 1;
37550 : }
37551 : }
37552 : #endif
37553 : {
37554 16 : PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
37555 16 : __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
37556 16 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
37557 16 : if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2380, __pyx_L1_error)
37558 16 : __Pyx_GOTREF(__pyx_t_8);
37559 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37560 : }
37561 16 : __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __pyx_L1_error)
37562 16 : __Pyx_GOTREF(__pyx_t_6);
37563 16 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
37564 16 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37565 16 : __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_v_r1), __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2380, __pyx_L1_error)
37566 16 : __Pyx_GOTREF(__pyx_t_8);
37567 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37568 16 : __pyx_v_rnew = __pyx_t_8;
37569 16 : __pyx_t_8 = 0;
37570 :
37571 : /* "scipy/linalg/_decomp_update.pyx":2381
37572 : * if m == 1:
37573 : * rnew = r1 + q1.conjugate()*u1.ravel()*v1.conjugate().ravel()
37574 : * return q1.copy(), rnew # <<<<<<<<<<<<<<
37575 : *
37576 : * if economic:
37577 : */
37578 16 : __Pyx_XDECREF(__pyx_r);
37579 16 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_q1), __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2381, __pyx_L1_error)
37580 16 : __Pyx_GOTREF(__pyx_t_6);
37581 16 : __pyx_t_7 = NULL;
37582 16 : __pyx_t_13 = 0;
37583 : #if CYTHON_UNPACK_METHODS
37584 16 : if (likely(PyMethod_Check(__pyx_t_6))) {
37585 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
37586 0 : if (likely(__pyx_t_7)) {
37587 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
37588 0 : __Pyx_INCREF(__pyx_t_7);
37589 0 : __Pyx_INCREF(function);
37590 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
37591 : __pyx_t_13 = 1;
37592 : }
37593 : }
37594 : #endif
37595 : {
37596 16 : PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
37597 16 : __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
37598 16 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
37599 16 : if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2381, __pyx_L1_error)
37600 16 : __Pyx_GOTREF(__pyx_t_8);
37601 16 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37602 : }
37603 16 : __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2381, __pyx_L1_error)
37604 16 : __Pyx_GOTREF(__pyx_t_6);
37605 16 : __Pyx_GIVEREF(__pyx_t_8);
37606 16 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8)) __PYX_ERR(0, 2381, __pyx_L1_error);
37607 16 : __Pyx_INCREF(__pyx_v_rnew);
37608 16 : __Pyx_GIVEREF(__pyx_v_rnew);
37609 16 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_rnew)) __PYX_ERR(0, 2381, __pyx_L1_error);
37610 16 : __pyx_t_8 = 0;
37611 16 : __pyx_r = __pyx_t_6;
37612 16 : __pyx_t_6 = 0;
37613 16 : goto __pyx_L0;
37614 :
37615 : /* "scipy/linalg/_decomp_update.pyx":2379
37616 : * # we only need consider rank 1 updates, since we have
37617 : * # limited p to max(m,n) above.
37618 : * if m == 1: # <<<<<<<<<<<<<<
37619 : * rnew = r1 + q1.conjugate()*u1.ravel()*v1.conjugate().ravel()
37620 : * return q1.copy(), rnew
37621 : */
37622 : }
37623 :
37624 : /* "scipy/linalg/_decomp_update.pyx":2383
37625 : * return q1.copy(), rnew
37626 : *
37627 : * if economic: # <<<<<<<<<<<<<<
37628 : * ndim = 1
37629 : * length = 2*n
37630 : */
37631 2052 : if (__pyx_v_economic) {
37632 :
37633 : /* "scipy/linalg/_decomp_update.pyx":2384
37634 : *
37635 : * if economic:
37636 : * ndim = 1 # <<<<<<<<<<<<<<
37637 : * length = 2*n
37638 : * s = cnp.PyArray_ZEROS(ndim, &length, typecode, 1)
37639 : */
37640 364 : __pyx_v_ndim = 1;
37641 :
37642 : /* "scipy/linalg/_decomp_update.pyx":2385
37643 : * if economic:
37644 : * ndim = 1
37645 : * length = 2*n # <<<<<<<<<<<<<<
37646 : * s = cnp.PyArray_ZEROS(ndim, &length, typecode, 1)
37647 : * if not cnp.PyArray_ISONESEGMENT(q1):
37648 : */
37649 364 : __pyx_v_length = (2 * __pyx_v_n);
37650 :
37651 : /* "scipy/linalg/_decomp_update.pyx":2386
37652 : * ndim = 1
37653 : * length = 2*n
37654 : * s = cnp.PyArray_ZEROS(ndim, &length, typecode, 1) # <<<<<<<<<<<<<<
37655 : * if not cnp.PyArray_ISONESEGMENT(q1):
37656 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
37657 : */
37658 364 : __pyx_t_6 = PyArray_ZEROS(__pyx_v_ndim, (&__pyx_v_length), __pyx_v_typecode, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2386, __pyx_L1_error)
37659 364 : __Pyx_GOTREF(__pyx_t_6);
37660 364 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2386, __pyx_L1_error)
37661 364 : __pyx_v_s = ((PyArrayObject *)__pyx_t_6);
37662 364 : __pyx_t_6 = 0;
37663 :
37664 : /* "scipy/linalg/_decomp_update.pyx":2387
37665 : * length = 2*n
37666 : * s = cnp.PyArray_ZEROS(ndim, &length, typecode, 1)
37667 : * if not cnp.PyArray_ISONESEGMENT(q1): # <<<<<<<<<<<<<<
37668 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
37669 : * qisF = True
37670 : */
37671 364 : __pyx_t_1 = (!PyArray_ISONESEGMENT(__pyx_v_q1));
37672 364 : if (__pyx_t_1) {
37673 :
37674 : /* "scipy/linalg/_decomp_update.pyx":2388
37675 : * s = cnp.PyArray_ZEROS(ndim, &length, typecode, 1)
37676 : * if not cnp.PyArray_ISONESEGMENT(q1):
37677 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
37678 : * qisF = True
37679 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
37680 : */
37681 16 : __pyx_t_6 = ((PyObject *)PyArray_FromArray(__pyx_v_q1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2388, __pyx_L1_error)
37682 16 : __Pyx_GOTREF(__pyx_t_6);
37683 16 : __Pyx_DECREF_SET(__pyx_v_q1, ((PyArrayObject *)__pyx_t_6));
37684 16 : __pyx_t_6 = 0;
37685 :
37686 : /* "scipy/linalg/_decomp_update.pyx":2389
37687 : * if not cnp.PyArray_ISONESEGMENT(q1):
37688 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
37689 : * qisF = True # <<<<<<<<<<<<<<
37690 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
37691 : * qisF = True
37692 : */
37693 16 : __pyx_v_qisF = 1;
37694 :
37695 : /* "scipy/linalg/_decomp_update.pyx":2387
37696 : * length = 2*n
37697 : * s = cnp.PyArray_ZEROS(ndim, &length, typecode, 1)
37698 : * if not cnp.PyArray_ISONESEGMENT(q1): # <<<<<<<<<<<<<<
37699 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
37700 : * qisF = True
37701 : */
37702 16 : goto __pyx_L24;
37703 : }
37704 :
37705 : /* "scipy/linalg/_decomp_update.pyx":2390
37706 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
37707 : * qisF = True
37708 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
37709 : * qisF = True
37710 : * else:
37711 : */
37712 348 : __pyx_t_1 = PyArray_CHKFLAGS(__pyx_v_q1, NPY_ARRAY_F_CONTIGUOUS);
37713 348 : if (__pyx_t_1) {
37714 :
37715 : /* "scipy/linalg/_decomp_update.pyx":2391
37716 : * qisF = True
37717 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
37718 : * qisF = True # <<<<<<<<<<<<<<
37719 : * else:
37720 : * qisF = False
37721 : */
37722 292 : __pyx_v_qisF = 1;
37723 :
37724 : /* "scipy/linalg/_decomp_update.pyx":2390
37725 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
37726 : * qisF = True
37727 : * elif cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
37728 : * qisF = True
37729 : * else:
37730 : */
37731 292 : goto __pyx_L24;
37732 : }
37733 :
37734 : /* "scipy/linalg/_decomp_update.pyx":2393
37735 : * qisF = True
37736 : * else:
37737 : * qisF = False # <<<<<<<<<<<<<<
37738 : * qptr = extract(q1, qs)
37739 : * rptr = extract(r1, rs)
37740 : */
37741 : /*else*/ {
37742 : __pyx_v_qisF = 0;
37743 : }
37744 364 : __pyx_L24:;
37745 :
37746 : /* "scipy/linalg/_decomp_update.pyx":2394
37747 : * else:
37748 : * qisF = False
37749 : * qptr = extract(q1, qs) # <<<<<<<<<<<<<<
37750 : * rptr = extract(r1, rs)
37751 : * uptr = extract(u1, us)
37752 : */
37753 364 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q1, __pyx_v_qs);
37754 :
37755 : /* "scipy/linalg/_decomp_update.pyx":2395
37756 : * qisF = False
37757 : * qptr = extract(q1, qs)
37758 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
37759 : * uptr = extract(u1, us)
37760 : * vptr = extract(v1, vs)
37761 : */
37762 364 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
37763 :
37764 : /* "scipy/linalg/_decomp_update.pyx":2396
37765 : * qptr = extract(q1, qs)
37766 : * rptr = extract(r1, rs)
37767 : * uptr = extract(u1, us) # <<<<<<<<<<<<<<
37768 : * vptr = extract(v1, vs)
37769 : * sptr = extract(s, ss)
37770 : */
37771 364 : __pyx_v_uptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_u1, __pyx_v_us);
37772 :
37773 : /* "scipy/linalg/_decomp_update.pyx":2397
37774 : * rptr = extract(r1, rs)
37775 : * uptr = extract(u1, us)
37776 : * vptr = extract(v1, vs) # <<<<<<<<<<<<<<
37777 : * sptr = extract(s, ss)
37778 : * with nogil:
37779 : */
37780 364 : __pyx_v_vptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_v1, __pyx_v_vs);
37781 :
37782 : /* "scipy/linalg/_decomp_update.pyx":2398
37783 : * uptr = extract(u1, us)
37784 : * vptr = extract(v1, vs)
37785 : * sptr = extract(s, ss) # <<<<<<<<<<<<<<
37786 : * with nogil:
37787 : * if p == 1:
37788 : */
37789 364 : __pyx_v_sptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_s, __pyx_v_ss);
37790 :
37791 : /* "scipy/linalg/_decomp_update.pyx":2399
37792 : * vptr = extract(v1, vs)
37793 : * sptr = extract(s, ss)
37794 : * with nogil: # <<<<<<<<<<<<<<
37795 : * if p == 1:
37796 : * if typecode == cnp.NPY_FLOAT:
37797 : */
37798 : {
37799 : #ifdef WITH_THREAD
37800 364 : PyThreadState *_save;
37801 364 : _save = NULL;
37802 364 : Py_UNBLOCK_THREADS
37803 364 : __Pyx_FastGIL_Remember();
37804 : #endif
37805 : /*try:*/ {
37806 :
37807 : /* "scipy/linalg/_decomp_update.pyx":2400
37808 : * sptr = extract(s, ss)
37809 : * with nogil:
37810 : * if p == 1: # <<<<<<<<<<<<<<
37811 : * if typecode == cnp.NPY_FLOAT:
37812 : * thin_qr_rank_1_update(m, n, <float*>qptr, qs, qisF,
37813 : */
37814 364 : __pyx_t_1 = (__pyx_v_p == 1);
37815 364 : if (__pyx_t_1) {
37816 :
37817 : /* "scipy/linalg/_decomp_update.pyx":2401
37818 : * with nogil:
37819 : * if p == 1:
37820 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
37821 : * thin_qr_rank_1_update(m, n, <float*>qptr, qs, qisF,
37822 : * <float*>rptr, rs, <float*>uptr, us,
37823 : */
37824 192 : switch (__pyx_v_typecode) {
37825 48 : case NPY_FLOAT:
37826 :
37827 : /* "scipy/linalg/_decomp_update.pyx":2402
37828 : * if p == 1:
37829 : * if typecode == cnp.NPY_FLOAT:
37830 : * thin_qr_rank_1_update(m, n, <float*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37831 : * <float*>rptr, rs, <float*>uptr, us,
37832 : * <float*>vptr, vs, <float*>sptr, ss)
37833 : */
37834 48 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((float *)__pyx_v_rptr), __pyx_v_rs, ((float *)__pyx_v_uptr), __pyx_v_us, ((float *)__pyx_v_vptr), __pyx_v_vs, ((float *)__pyx_v_sptr), __pyx_v_ss);
37835 :
37836 : /* "scipy/linalg/_decomp_update.pyx":2401
37837 : * with nogil:
37838 : * if p == 1:
37839 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
37840 : * thin_qr_rank_1_update(m, n, <float*>qptr, qs, qisF,
37841 : * <float*>rptr, rs, <float*>uptr, us,
37842 : */
37843 48 : break;
37844 48 : case NPY_DOUBLE:
37845 :
37846 : /* "scipy/linalg/_decomp_update.pyx":2406
37847 : * <float*>vptr, vs, <float*>sptr, ss)
37848 : * elif typecode == cnp.NPY_DOUBLE:
37849 : * thin_qr_rank_1_update(m, n, <double*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37850 : * <double*>rptr, rs, <double*>uptr, us,
37851 : * <double*>vptr, vs, <double*>sptr, ss)
37852 : */
37853 48 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((double *)__pyx_v_rptr), __pyx_v_rs, ((double *)__pyx_v_uptr), __pyx_v_us, ((double *)__pyx_v_vptr), __pyx_v_vs, ((double *)__pyx_v_sptr), __pyx_v_ss);
37854 :
37855 : /* "scipy/linalg/_decomp_update.pyx":2405
37856 : * <float*>rptr, rs, <float*>uptr, us,
37857 : * <float*>vptr, vs, <float*>sptr, ss)
37858 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
37859 : * thin_qr_rank_1_update(m, n, <double*>qptr, qs, qisF,
37860 : * <double*>rptr, rs, <double*>uptr, us,
37861 : */
37862 48 : break;
37863 48 : case NPY_CFLOAT:
37864 :
37865 : /* "scipy/linalg/_decomp_update.pyx":2410
37866 : * <double*>vptr, vs, <double*>sptr, ss)
37867 : * elif typecode == cnp.NPY_CFLOAT:
37868 : * thin_qr_rank_1_update(m, n, <float_complex*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37869 : * <float_complex*>rptr, rs, <float_complex*>uptr, us,
37870 : * <float_complex*>vptr, vs, <float_complex*>sptr, ss)
37871 : */
37872 48 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_float_complex *)__pyx_v_uptr), __pyx_v_us, ((__pyx_t_float_complex *)__pyx_v_vptr), __pyx_v_vs, ((__pyx_t_float_complex *)__pyx_v_sptr), __pyx_v_ss);
37873 :
37874 : /* "scipy/linalg/_decomp_update.pyx":2409
37875 : * <double*>rptr, rs, <double*>uptr, us,
37876 : * <double*>vptr, vs, <double*>sptr, ss)
37877 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
37878 : * thin_qr_rank_1_update(m, n, <float_complex*>qptr, qs, qisF,
37879 : * <float_complex*>rptr, rs, <float_complex*>uptr, us,
37880 : */
37881 48 : break;
37882 48 : default:
37883 :
37884 : /* "scipy/linalg/_decomp_update.pyx":2414
37885 : * <float_complex*>vptr, vs, <float_complex*>sptr, ss)
37886 : * else: # typecode == cnp.NPY_CDOUBLE:
37887 : * thin_qr_rank_1_update(m, n, <double_complex*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37888 : * <double_complex*>rptr, rs, <double_complex*>uptr, us,
37889 : * <double_complex*>vptr, vs, <double_complex*>sptr, ss)
37890 : */
37891 48 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_double_complex *)__pyx_v_uptr), __pyx_v_us, ((__pyx_t_double_complex *)__pyx_v_vptr), __pyx_v_vs, ((__pyx_t_double_complex *)__pyx_v_sptr), __pyx_v_ss);
37892 48 : break;
37893 : }
37894 :
37895 : /* "scipy/linalg/_decomp_update.pyx":2400
37896 : * sptr = extract(s, ss)
37897 : * with nogil:
37898 : * if p == 1: # <<<<<<<<<<<<<<
37899 : * if typecode == cnp.NPY_FLOAT:
37900 : * thin_qr_rank_1_update(m, n, <float*>qptr, qs, qisF,
37901 : */
37902 192 : goto __pyx_L28;
37903 : }
37904 :
37905 : /* "scipy/linalg/_decomp_update.pyx":2418
37906 : * <double_complex*>vptr, vs, <double_complex*>sptr, ss)
37907 : * else:
37908 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
37909 : * thin_qr_rank_p_update(m, n, p, <float*>qptr, qs, qisF,
37910 : * <float*>rptr, rs, <float*>uptr, us,
37911 : */
37912 : /*else*/ {
37913 :
37914 : /* "scipy/linalg/_decomp_update.pyx":2426
37915 : * <double*>rptr, rs, <double*>uptr, us,
37916 : * <double*>vptr, vs, <double*>sptr, ss)
37917 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
37918 : * thin_qr_rank_p_update(m, n, p, <float_complex*>qptr, qs, qisF,
37919 : * <float_complex*>rptr, rs, <float_complex*>uptr, us,
37920 : */
37921 172 : switch (__pyx_v_typecode) {
37922 43 : case NPY_FLOAT:
37923 :
37924 : /* "scipy/linalg/_decomp_update.pyx":2419
37925 : * else:
37926 : * if typecode == cnp.NPY_FLOAT:
37927 : * thin_qr_rank_p_update(m, n, p, <float*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37928 : * <float*>rptr, rs, <float*>uptr, us,
37929 : * <float*>vptr, vs, <float*>sptr, ss)
37930 : */
37931 43 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((float *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((float *)__pyx_v_rptr), __pyx_v_rs, ((float *)__pyx_v_uptr), __pyx_v_us, ((float *)__pyx_v_vptr), __pyx_v_vs, ((float *)__pyx_v_sptr), __pyx_v_ss);
37932 :
37933 : /* "scipy/linalg/_decomp_update.pyx":2418
37934 : * <double_complex*>vptr, vs, <double_complex*>sptr, ss)
37935 : * else:
37936 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
37937 : * thin_qr_rank_p_update(m, n, p, <float*>qptr, qs, qisF,
37938 : * <float*>rptr, rs, <float*>uptr, us,
37939 : */
37940 43 : break;
37941 43 : case NPY_DOUBLE:
37942 :
37943 : /* "scipy/linalg/_decomp_update.pyx":2423
37944 : * <float*>vptr, vs, <float*>sptr, ss)
37945 : * elif typecode == cnp.NPY_DOUBLE:
37946 : * thin_qr_rank_p_update(m, n, p, <double*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37947 : * <double*>rptr, rs, <double*>uptr, us,
37948 : * <double*>vptr, vs, <double*>sptr, ss)
37949 : */
37950 43 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((double *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((double *)__pyx_v_rptr), __pyx_v_rs, ((double *)__pyx_v_uptr), __pyx_v_us, ((double *)__pyx_v_vptr), __pyx_v_vs, ((double *)__pyx_v_sptr), __pyx_v_ss);
37951 :
37952 : /* "scipy/linalg/_decomp_update.pyx":2422
37953 : * <float*>rptr, rs, <float*>uptr, us,
37954 : * <float*>vptr, vs, <float*>sptr, ss)
37955 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
37956 : * thin_qr_rank_p_update(m, n, p, <double*>qptr, qs, qisF,
37957 : * <double*>rptr, rs, <double*>uptr, us,
37958 : */
37959 43 : break;
37960 43 : case NPY_CFLOAT:
37961 :
37962 : /* "scipy/linalg/_decomp_update.pyx":2427
37963 : * <double*>vptr, vs, <double*>sptr, ss)
37964 : * elif typecode == cnp.NPY_CFLOAT:
37965 : * thin_qr_rank_p_update(m, n, p, <float_complex*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37966 : * <float_complex*>rptr, rs, <float_complex*>uptr, us,
37967 : * <float_complex*>vptr, vs, <float_complex*>sptr, ss)
37968 : */
37969 43 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_float_complex *)__pyx_v_uptr), __pyx_v_us, ((__pyx_t_float_complex *)__pyx_v_vptr), __pyx_v_vs, ((__pyx_t_float_complex *)__pyx_v_sptr), __pyx_v_ss);
37970 :
37971 : /* "scipy/linalg/_decomp_update.pyx":2426
37972 : * <double*>rptr, rs, <double*>uptr, us,
37973 : * <double*>vptr, vs, <double*>sptr, ss)
37974 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
37975 : * thin_qr_rank_p_update(m, n, p, <float_complex*>qptr, qs, qisF,
37976 : * <float_complex*>rptr, rs, <float_complex*>uptr, us,
37977 : */
37978 43 : break;
37979 43 : default:
37980 :
37981 : /* "scipy/linalg/_decomp_update.pyx":2431
37982 : * <float_complex*>vptr, vs, <float_complex*>sptr, ss)
37983 : * else: # typecode == cnp.NPY_CDOUBLE:
37984 : * thin_qr_rank_p_update(m, n, p, <double_complex*>qptr, qs, qisF, # <<<<<<<<<<<<<<
37985 : * <double_complex*>rptr, rs, <double_complex*>uptr, us,
37986 : * <double_complex*>vptr, vs, <double_complex*>sptr, ss)
37987 : */
37988 43 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_thin_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, __pyx_v_qisF, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_double_complex *)__pyx_v_uptr), __pyx_v_us, ((__pyx_t_double_complex *)__pyx_v_vptr), __pyx_v_vs, ((__pyx_t_double_complex *)__pyx_v_sptr), __pyx_v_ss);
37989 43 : break;
37990 : }
37991 : }
37992 364 : __pyx_L28:;
37993 : }
37994 :
37995 : /* "scipy/linalg/_decomp_update.pyx":2399
37996 : * vptr = extract(v1, vs)
37997 : * sptr = extract(s, ss)
37998 : * with nogil: # <<<<<<<<<<<<<<
37999 : * if p == 1:
38000 : * if typecode == cnp.NPY_FLOAT:
38001 : */
38002 : /*finally:*/ {
38003 : /*normal exit:*/{
38004 : #ifdef WITH_THREAD
38005 364 : __Pyx_FastGIL_Forget();
38006 364 : Py_BLOCK_THREADS
38007 : #endif
38008 364 : goto __pyx_L27;
38009 : }
38010 364 : __pyx_L27:;
38011 : }
38012 : }
38013 :
38014 : /* "scipy/linalg/_decomp_update.pyx":2383
38015 : * return q1.copy(), rnew
38016 : *
38017 : * if economic: # <<<<<<<<<<<<<<
38018 : * ndim = 1
38019 : * length = 2*n
38020 : */
38021 364 : goto __pyx_L23;
38022 : }
38023 :
38024 : /* "scipy/linalg/_decomp_update.pyx":2435
38025 : * <double_complex*>vptr, vs, <double_complex*>sptr, ss)
38026 : * else:
38027 : * if m == 1: # <<<<<<<<<<<<<<
38028 : * if p == 1:
38029 : * r1 += q1.conj() * u1 * v1.T.conj()
38030 : */
38031 : /*else*/ {
38032 1688 : __pyx_t_1 = (__pyx_v_m == 1);
38033 1688 : if (__pyx_t_1) {
38034 :
38035 : /* "scipy/linalg/_decomp_update.pyx":2436
38036 : * else:
38037 : * if m == 1:
38038 : * if p == 1: # <<<<<<<<<<<<<<
38039 : * r1 += q1.conj() * u1 * v1.T.conj()
38040 : * else:
38041 : */
38042 : __pyx_t_1 = (__pyx_v_p == 1);
38043 : if (__pyx_t_1) {
38044 :
38045 : /* "scipy/linalg/_decomp_update.pyx":2437
38046 : * if m == 1:
38047 : * if p == 1:
38048 : * r1 += q1.conj() * u1 * v1.T.conj() # <<<<<<<<<<<<<<
38049 : * else:
38050 : * r1 += q1.conj() * np.dot(u1, v1.T.conj())
38051 : */
38052 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_q1), __pyx_n_s_conj); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2437, __pyx_L1_error)
38053 : __Pyx_GOTREF(__pyx_t_8);
38054 : __pyx_t_7 = NULL;
38055 : __pyx_t_13 = 0;
38056 : #if CYTHON_UNPACK_METHODS
38057 : if (likely(PyMethod_Check(__pyx_t_8))) {
38058 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
38059 : if (likely(__pyx_t_7)) {
38060 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
38061 : __Pyx_INCREF(__pyx_t_7);
38062 : __Pyx_INCREF(function);
38063 : __Pyx_DECREF_SET(__pyx_t_8, function);
38064 : __pyx_t_13 = 1;
38065 : }
38066 : }
38067 : #endif
38068 : {
38069 : PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
38070 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
38071 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
38072 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2437, __pyx_L1_error)
38073 : __Pyx_GOTREF(__pyx_t_6);
38074 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
38075 : }
38076 : __pyx_t_8 = PyNumber_Multiply(__pyx_t_6, ((PyObject *)__pyx_v_u1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2437, __pyx_L1_error)
38077 : __Pyx_GOTREF(__pyx_t_8);
38078 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
38079 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_v1), __pyx_n_s_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2437, __pyx_L1_error)
38080 : __Pyx_GOTREF(__pyx_t_7);
38081 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_conj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2437, __pyx_L1_error)
38082 : __Pyx_GOTREF(__pyx_t_2);
38083 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
38084 : __pyx_t_7 = NULL;
38085 : __pyx_t_13 = 0;
38086 : #if CYTHON_UNPACK_METHODS
38087 : if (likely(PyMethod_Check(__pyx_t_2))) {
38088 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
38089 : if (likely(__pyx_t_7)) {
38090 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
38091 : __Pyx_INCREF(__pyx_t_7);
38092 : __Pyx_INCREF(function);
38093 : __Pyx_DECREF_SET(__pyx_t_2, function);
38094 : __pyx_t_13 = 1;
38095 : }
38096 : }
38097 : #endif
38098 : {
38099 : PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
38100 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
38101 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
38102 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2437, __pyx_L1_error)
38103 : __Pyx_GOTREF(__pyx_t_6);
38104 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38105 : }
38106 : __pyx_t_2 = PyNumber_Multiply(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2437, __pyx_L1_error)
38107 : __Pyx_GOTREF(__pyx_t_2);
38108 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
38109 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
38110 : __pyx_t_6 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_r1), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2437, __pyx_L1_error)
38111 : __Pyx_GOTREF(__pyx_t_6);
38112 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38113 : if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2437, __pyx_L1_error)
38114 : __Pyx_DECREF_SET(__pyx_v_r1, ((PyArrayObject *)__pyx_t_6));
38115 : __pyx_t_6 = 0;
38116 :
38117 : /* "scipy/linalg/_decomp_update.pyx":2436
38118 : * else:
38119 : * if m == 1:
38120 : * if p == 1: # <<<<<<<<<<<<<<
38121 : * r1 += q1.conj() * u1 * v1.T.conj()
38122 : * else:
38123 : */
38124 : goto __pyx_L30;
38125 : }
38126 :
38127 : /* "scipy/linalg/_decomp_update.pyx":2439
38128 : * r1 += q1.conj() * u1 * v1.T.conj()
38129 : * else:
38130 : * r1 += q1.conj() * np.dot(u1, v1.T.conj()) # <<<<<<<<<<<<<<
38131 : * return q1, r1
38132 : * qTu = cnp.PyArray_ZEROS(u1.ndim, u1.shape, typecode, 1)
38133 : */
38134 : /*else*/ {
38135 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_q1), __pyx_n_s_conj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error)
38136 : __Pyx_GOTREF(__pyx_t_2);
38137 : __pyx_t_8 = NULL;
38138 : __pyx_t_13 = 0;
38139 : #if CYTHON_UNPACK_METHODS
38140 : if (likely(PyMethod_Check(__pyx_t_2))) {
38141 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
38142 : if (likely(__pyx_t_8)) {
38143 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
38144 : __Pyx_INCREF(__pyx_t_8);
38145 : __Pyx_INCREF(function);
38146 : __Pyx_DECREF_SET(__pyx_t_2, function);
38147 : __pyx_t_13 = 1;
38148 : }
38149 : }
38150 : #endif
38151 : {
38152 : PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
38153 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
38154 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
38155 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2439, __pyx_L1_error)
38156 : __Pyx_GOTREF(__pyx_t_6);
38157 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38158 : }
38159 : __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2439, __pyx_L1_error)
38160 : __Pyx_GOTREF(__pyx_t_8);
38161 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2439, __pyx_L1_error)
38162 : __Pyx_GOTREF(__pyx_t_7);
38163 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
38164 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_v1), __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2439, __pyx_L1_error)
38165 : __Pyx_GOTREF(__pyx_t_5);
38166 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_conj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2439, __pyx_L1_error)
38167 : __Pyx_GOTREF(__pyx_t_4);
38168 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
38169 : __pyx_t_5 = NULL;
38170 : __pyx_t_13 = 0;
38171 : #if CYTHON_UNPACK_METHODS
38172 : if (likely(PyMethod_Check(__pyx_t_4))) {
38173 : __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
38174 : if (likely(__pyx_t_5)) {
38175 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
38176 : __Pyx_INCREF(__pyx_t_5);
38177 : __Pyx_INCREF(function);
38178 : __Pyx_DECREF_SET(__pyx_t_4, function);
38179 : __pyx_t_13 = 1;
38180 : }
38181 : }
38182 : #endif
38183 : {
38184 : PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
38185 : __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_13, 0+__pyx_t_13);
38186 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
38187 : if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2439, __pyx_L1_error)
38188 : __Pyx_GOTREF(__pyx_t_8);
38189 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38190 : }
38191 : __pyx_t_4 = NULL;
38192 : __pyx_t_13 = 0;
38193 : #if CYTHON_UNPACK_METHODS
38194 : if (unlikely(PyMethod_Check(__pyx_t_7))) {
38195 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
38196 : if (likely(__pyx_t_4)) {
38197 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
38198 : __Pyx_INCREF(__pyx_t_4);
38199 : __Pyx_INCREF(function);
38200 : __Pyx_DECREF_SET(__pyx_t_7, function);
38201 : __pyx_t_13 = 1;
38202 : }
38203 : }
38204 : #endif
38205 : {
38206 : PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_u1), __pyx_t_8};
38207 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_13, 2+__pyx_t_13);
38208 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
38209 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
38210 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error)
38211 : __Pyx_GOTREF(__pyx_t_2);
38212 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
38213 : }
38214 : __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2439, __pyx_L1_error)
38215 : __Pyx_GOTREF(__pyx_t_7);
38216 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
38217 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38218 : __pyx_t_2 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_r1), __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error)
38219 : __Pyx_GOTREF(__pyx_t_2);
38220 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
38221 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2439, __pyx_L1_error)
38222 : __Pyx_DECREF_SET(__pyx_v_r1, ((PyArrayObject *)__pyx_t_2));
38223 : __pyx_t_2 = 0;
38224 : }
38225 : __pyx_L30:;
38226 :
38227 : /* "scipy/linalg/_decomp_update.pyx":2440
38228 : * else:
38229 : * r1 += q1.conj() * np.dot(u1, v1.T.conj())
38230 : * return q1, r1 # <<<<<<<<<<<<<<
38231 : * qTu = cnp.PyArray_ZEROS(u1.ndim, u1.shape, typecode, 1)
38232 : * qTuptr = extract(qTu, qTus)
38233 : */
38234 : __Pyx_XDECREF(__pyx_r);
38235 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2440, __pyx_L1_error)
38236 : __Pyx_GOTREF(__pyx_t_2);
38237 : __Pyx_INCREF((PyObject *)__pyx_v_q1);
38238 : __Pyx_GIVEREF((PyObject *)__pyx_v_q1);
38239 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_q1))) __PYX_ERR(0, 2440, __pyx_L1_error);
38240 : __Pyx_INCREF((PyObject *)__pyx_v_r1);
38241 : __Pyx_GIVEREF((PyObject *)__pyx_v_r1);
38242 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_r1))) __PYX_ERR(0, 2440, __pyx_L1_error);
38243 : __pyx_r = __pyx_t_2;
38244 : __pyx_t_2 = 0;
38245 : goto __pyx_L0;
38246 :
38247 : /* "scipy/linalg/_decomp_update.pyx":2435
38248 : * <double_complex*>vptr, vs, <double_complex*>sptr, ss)
38249 : * else:
38250 : * if m == 1: # <<<<<<<<<<<<<<
38251 : * if p == 1:
38252 : * r1 += q1.conj() * u1 * v1.T.conj()
38253 : */
38254 : }
38255 :
38256 : /* "scipy/linalg/_decomp_update.pyx":2441
38257 : * r1 += q1.conj() * np.dot(u1, v1.T.conj())
38258 : * return q1, r1
38259 : * qTu = cnp.PyArray_ZEROS(u1.ndim, u1.shape, typecode, 1) # <<<<<<<<<<<<<<
38260 : * qTuptr = extract(qTu, qTus)
38261 : * if p == 1:
38262 : */
38263 1688 : __pyx_t_2 = PyArray_ZEROS(__pyx_f_5numpy_7ndarray_4ndim_ndim(__pyx_v_u1), __pyx_f_5numpy_7ndarray_5shape_shape(__pyx_v_u1), __pyx_v_typecode, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2441, __pyx_L1_error)
38264 1688 : __Pyx_GOTREF(__pyx_t_2);
38265 1688 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2441, __pyx_L1_error)
38266 1688 : __pyx_v_qTu = ((PyArrayObject *)__pyx_t_2);
38267 1688 : __pyx_t_2 = 0;
38268 :
38269 : /* "scipy/linalg/_decomp_update.pyx":2442
38270 : * return q1, r1
38271 : * qTu = cnp.PyArray_ZEROS(u1.ndim, u1.shape, typecode, 1)
38272 : * qTuptr = extract(qTu, qTus) # <<<<<<<<<<<<<<
38273 : * if p == 1:
38274 : * if not cnp.PyArray_ISONESEGMENT(q1):
38275 : */
38276 1688 : __pyx_v_qTuptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_qTu, __pyx_v_qTus);
38277 :
38278 : /* "scipy/linalg/_decomp_update.pyx":2443
38279 : * qTu = cnp.PyArray_ZEROS(u1.ndim, u1.shape, typecode, 1)
38280 : * qTuptr = extract(qTu, qTus)
38281 : * if p == 1: # <<<<<<<<<<<<<<
38282 : * if not cnp.PyArray_ISONESEGMENT(q1):
38283 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38284 : */
38285 1688 : __pyx_t_1 = (__pyx_v_p == 1);
38286 1688 : if (__pyx_t_1) {
38287 :
38288 : /* "scipy/linalg/_decomp_update.pyx":2444
38289 : * qTuptr = extract(qTu, qTus)
38290 : * if p == 1:
38291 : * if not cnp.PyArray_ISONESEGMENT(q1): # <<<<<<<<<<<<<<
38292 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38293 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38294 : */
38295 844 : __pyx_t_1 = (!PyArray_ISONESEGMENT(__pyx_v_q1));
38296 40 : if (__pyx_t_1) {
38297 :
38298 : /* "scipy/linalg/_decomp_update.pyx":2445
38299 : * if p == 1:
38300 : * if not cnp.PyArray_ISONESEGMENT(q1):
38301 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
38302 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38303 : * qptr = extract(q1, qs)
38304 : */
38305 40 : __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_q1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2445, __pyx_L1_error)
38306 40 : __Pyx_GOTREF(__pyx_t_2);
38307 40 : __Pyx_DECREF_SET(__pyx_v_q1, ((PyArrayObject *)__pyx_t_2));
38308 844 : __pyx_t_2 = 0;
38309 :
38310 : /* "scipy/linalg/_decomp_update.pyx":2444
38311 : * qTuptr = extract(qTu, qTus)
38312 : * if p == 1:
38313 : * if not cnp.PyArray_ISONESEGMENT(q1): # <<<<<<<<<<<<<<
38314 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38315 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38316 : */
38317 : }
38318 :
38319 : /* "scipy/linalg/_decomp_update.pyx":2446
38320 : * if not cnp.PyArray_ISONESEGMENT(q1):
38321 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38322 : * form_qTu(q1, u1, qTuptr, qTus, 0) # <<<<<<<<<<<<<<
38323 : * qptr = extract(q1, qs)
38324 : * rptr = extract(r1, rs)
38325 : */
38326 844 : __pyx_t_2 = __pyx_f_5scipy_6linalg_14_decomp_update_form_qTu(__pyx_v_q1, __pyx_v_u1, __pyx_v_qTuptr, __pyx_v_qTus, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2446, __pyx_L1_error)
38327 844 : __Pyx_GOTREF(__pyx_t_2);
38328 844 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38329 :
38330 : /* "scipy/linalg/_decomp_update.pyx":2447
38331 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38332 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38333 : * qptr = extract(q1, qs) # <<<<<<<<<<<<<<
38334 : * rptr = extract(r1, rs)
38335 : * vptr = extract(v1, vs)
38336 : */
38337 844 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q1, __pyx_v_qs);
38338 :
38339 : /* "scipy/linalg/_decomp_update.pyx":2448
38340 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38341 : * qptr = extract(q1, qs)
38342 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
38343 : * vptr = extract(v1, vs)
38344 : * with nogil:
38345 : */
38346 844 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
38347 :
38348 : /* "scipy/linalg/_decomp_update.pyx":2449
38349 : * qptr = extract(q1, qs)
38350 : * rptr = extract(r1, rs)
38351 : * vptr = extract(v1, vs) # <<<<<<<<<<<<<<
38352 : * with nogil:
38353 : * if typecode == cnp.NPY_FLOAT:
38354 : */
38355 844 : __pyx_v_vptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_v1, __pyx_v_vs);
38356 :
38357 : /* "scipy/linalg/_decomp_update.pyx":2450
38358 : * rptr = extract(r1, rs)
38359 : * vptr = extract(v1, vs)
38360 : * with nogil: # <<<<<<<<<<<<<<
38361 : * if typecode == cnp.NPY_FLOAT:
38362 : * qr_rank_1_update(m, n, <float*>qptr, qs,
38363 : */
38364 : {
38365 : #ifdef WITH_THREAD
38366 844 : PyThreadState *_save;
38367 844 : _save = NULL;
38368 844 : Py_UNBLOCK_THREADS
38369 844 : __Pyx_FastGIL_Remember();
38370 : #endif
38371 : /*try:*/ {
38372 :
38373 : /* "scipy/linalg/_decomp_update.pyx":2451
38374 : * vptr = extract(v1, vs)
38375 : * with nogil:
38376 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
38377 : * qr_rank_1_update(m, n, <float*>qptr, qs,
38378 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38379 : */
38380 844 : switch (__pyx_v_typecode) {
38381 211 : case NPY_FLOAT:
38382 :
38383 : /* "scipy/linalg/_decomp_update.pyx":2452
38384 : * with nogil:
38385 : * if typecode == cnp.NPY_FLOAT:
38386 : * qr_rank_1_update(m, n, <float*>qptr, qs, # <<<<<<<<<<<<<<
38387 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38388 : * <float*>vptr, vs)
38389 : */
38390 211 : __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, ((float *)__pyx_v_qTuptr), __pyx_v_qTus, ((float *)__pyx_v_vptr), __pyx_v_vs);
38391 :
38392 : /* "scipy/linalg/_decomp_update.pyx":2451
38393 : * vptr = extract(v1, vs)
38394 : * with nogil:
38395 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
38396 : * qr_rank_1_update(m, n, <float*>qptr, qs,
38397 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38398 : */
38399 211 : break;
38400 211 : case NPY_DOUBLE:
38401 :
38402 : /* "scipy/linalg/_decomp_update.pyx":2456
38403 : * <float*>vptr, vs)
38404 : * elif typecode == cnp.NPY_DOUBLE:
38405 : * qr_rank_1_update(m, n, <double*>qptr, qs, # <<<<<<<<<<<<<<
38406 : * <double*>rptr, rs, <double*>qTuptr, qTus,
38407 : * <double*>vptr, vs)
38408 : */
38409 211 : __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, ((double *)__pyx_v_qTuptr), __pyx_v_qTus, ((double *)__pyx_v_vptr), __pyx_v_vs);
38410 :
38411 : /* "scipy/linalg/_decomp_update.pyx":2455
38412 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38413 : * <float*>vptr, vs)
38414 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
38415 : * qr_rank_1_update(m, n, <double*>qptr, qs,
38416 : * <double*>rptr, rs, <double*>qTuptr, qTus,
38417 : */
38418 211 : break;
38419 211 : case NPY_CFLOAT:
38420 :
38421 : /* "scipy/linalg/_decomp_update.pyx":2460
38422 : * <double*>vptr, vs)
38423 : * elif typecode == cnp.NPY_CFLOAT:
38424 : * qr_rank_1_update(m, n, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
38425 : * <float_complex*>rptr, rs, <float_complex*>qTuptr, qTus,
38426 : * <float_complex*>vptr, vs)
38427 : */
38428 211 : __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_float_complex *)__pyx_v_qTuptr), __pyx_v_qTus, ((__pyx_t_float_complex *)__pyx_v_vptr), __pyx_v_vs);
38429 :
38430 : /* "scipy/linalg/_decomp_update.pyx":2459
38431 : * <double*>rptr, rs, <double*>qTuptr, qTus,
38432 : * <double*>vptr, vs)
38433 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
38434 : * qr_rank_1_update(m, n, <float_complex*>qptr, qs,
38435 : * <float_complex*>rptr, rs, <float_complex*>qTuptr, qTus,
38436 : */
38437 211 : break;
38438 211 : default:
38439 :
38440 : /* "scipy/linalg/_decomp_update.pyx":2464
38441 : * <float_complex*>vptr, vs)
38442 : * else: # typecode == cnp.NPY_CDOUBLE:
38443 : * qr_rank_1_update(m, n, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
38444 : * <double_complex*>rptr, rs, <double_complex*>qTuptr, qTus,
38445 : * <double_complex*>vptr, vs)
38446 : */
38447 211 : __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_1_update(__pyx_v_m, __pyx_v_n, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_double_complex *)__pyx_v_qTuptr), __pyx_v_qTus, ((__pyx_t_double_complex *)__pyx_v_vptr), __pyx_v_vs);
38448 211 : break;
38449 : }
38450 : }
38451 :
38452 : /* "scipy/linalg/_decomp_update.pyx":2450
38453 : * rptr = extract(r1, rs)
38454 : * vptr = extract(v1, vs)
38455 : * with nogil: # <<<<<<<<<<<<<<
38456 : * if typecode == cnp.NPY_FLOAT:
38457 : * qr_rank_1_update(m, n, <float*>qptr, qs,
38458 : */
38459 : /*finally:*/ {
38460 : /*normal exit:*/{
38461 : #ifdef WITH_THREAD
38462 844 : __Pyx_FastGIL_Forget();
38463 844 : Py_BLOCK_THREADS
38464 : #endif
38465 844 : goto __pyx_L35;
38466 : }
38467 844 : __pyx_L35:;
38468 : }
38469 : }
38470 :
38471 : /* "scipy/linalg/_decomp_update.pyx":2443
38472 : * qTu = cnp.PyArray_ZEROS(u1.ndim, u1.shape, typecode, 1)
38473 : * qTuptr = extract(qTu, qTus)
38474 : * if p == 1: # <<<<<<<<<<<<<<
38475 : * if not cnp.PyArray_ISONESEGMENT(q1):
38476 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38477 : */
38478 844 : goto __pyx_L31;
38479 : }
38480 :
38481 : /* "scipy/linalg/_decomp_update.pyx":2468
38482 : * <double_complex*>vptr, vs)
38483 : * else:
38484 : * if not cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
38485 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38486 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38487 : */
38488 : /*else*/ {
38489 844 : __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_q1, NPY_ARRAY_F_CONTIGUOUS));
38490 844 : if (__pyx_t_1) {
38491 :
38492 : /* "scipy/linalg/_decomp_update.pyx":2469
38493 : * else:
38494 : * if not cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38495 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
38496 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38497 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38498 : */
38499 160 : __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_q1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2469, __pyx_L1_error)
38500 160 : __Pyx_GOTREF(__pyx_t_2);
38501 160 : __Pyx_DECREF_SET(__pyx_v_q1, ((PyArrayObject *)__pyx_t_2));
38502 844 : __pyx_t_2 = 0;
38503 :
38504 : /* "scipy/linalg/_decomp_update.pyx":2468
38505 : * <double_complex*>vptr, vs)
38506 : * else:
38507 : * if not cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
38508 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38509 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38510 : */
38511 : }
38512 :
38513 : /* "scipy/linalg/_decomp_update.pyx":2470
38514 : * if not cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38515 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38516 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
38517 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38518 : * if not cnp.PyArray_ISONESEGMENT(u1):
38519 : */
38520 844 : __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_r1, NPY_ARRAY_F_CONTIGUOUS));
38521 844 : if (__pyx_t_1) {
38522 :
38523 : /* "scipy/linalg/_decomp_update.pyx":2471
38524 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38525 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38526 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
38527 : * if not cnp.PyArray_ISONESEGMENT(u1):
38528 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38529 : */
38530 256 : __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_r1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2471, __pyx_L1_error)
38531 256 : __Pyx_GOTREF(__pyx_t_2);
38532 256 : __Pyx_DECREF_SET(__pyx_v_r1, ((PyArrayObject *)__pyx_t_2));
38533 844 : __pyx_t_2 = 0;
38534 :
38535 : /* "scipy/linalg/_decomp_update.pyx":2470
38536 : * if not cnp.PyArray_CHKFLAGS(q1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38537 : * q1 = PyArray_FromArray(q1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38538 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS): # <<<<<<<<<<<<<<
38539 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38540 : * if not cnp.PyArray_ISONESEGMENT(u1):
38541 : */
38542 : }
38543 :
38544 : /* "scipy/linalg/_decomp_update.pyx":2472
38545 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38546 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38547 : * if not cnp.PyArray_ISONESEGMENT(u1): # <<<<<<<<<<<<<<
38548 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38549 : * # v.T must be F contiguous --> v must be C contiguous
38550 : */
38551 844 : __pyx_t_1 = (!PyArray_ISONESEGMENT(__pyx_v_u1));
38552 40 : if (__pyx_t_1) {
38553 :
38554 : /* "scipy/linalg/_decomp_update.pyx":2473
38555 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38556 : * if not cnp.PyArray_ISONESEGMENT(u1):
38557 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS) # <<<<<<<<<<<<<<
38558 : * # v.T must be F contiguous --> v must be C contiguous
38559 : * if not cnp.PyArray_CHKFLAGS(v1, cnp.NPY_ARRAY_C_CONTIGUOUS):
38560 : */
38561 40 : __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_u1, NULL, NPY_ARRAY_F_CONTIGUOUS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2473, __pyx_L1_error)
38562 40 : __Pyx_GOTREF(__pyx_t_2);
38563 40 : __Pyx_DECREF_SET(__pyx_v_u1, ((PyArrayObject *)__pyx_t_2));
38564 844 : __pyx_t_2 = 0;
38565 :
38566 : /* "scipy/linalg/_decomp_update.pyx":2472
38567 : * if not cnp.PyArray_CHKFLAGS(r1, cnp.NPY_ARRAY_F_CONTIGUOUS):
38568 : * r1 = PyArray_FromArray(r1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38569 : * if not cnp.PyArray_ISONESEGMENT(u1): # <<<<<<<<<<<<<<
38570 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38571 : * # v.T must be F contiguous --> v must be C contiguous
38572 : */
38573 : }
38574 :
38575 : /* "scipy/linalg/_decomp_update.pyx":2475
38576 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38577 : * # v.T must be F contiguous --> v must be C contiguous
38578 : * if not cnp.PyArray_CHKFLAGS(v1, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
38579 : * v1 = PyArray_FromArray(v1, NULL, cnp.NPY_ARRAY_C_CONTIGUOUS)
38580 : * v1 = v1.T
38581 : */
38582 844 : __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_v1, NPY_ARRAY_C_CONTIGUOUS));
38583 844 : if (__pyx_t_1) {
38584 :
38585 : /* "scipy/linalg/_decomp_update.pyx":2476
38586 : * # v.T must be F contiguous --> v must be C contiguous
38587 : * if not cnp.PyArray_CHKFLAGS(v1, cnp.NPY_ARRAY_C_CONTIGUOUS):
38588 : * v1 = PyArray_FromArray(v1, NULL, cnp.NPY_ARRAY_C_CONTIGUOUS) # <<<<<<<<<<<<<<
38589 : * v1 = v1.T
38590 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38591 : */
38592 80 : __pyx_t_2 = ((PyObject *)PyArray_FromArray(__pyx_v_v1, NULL, NPY_ARRAY_C_CONTIGUOUS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2476, __pyx_L1_error)
38593 80 : __Pyx_GOTREF(__pyx_t_2);
38594 80 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_2));
38595 844 : __pyx_t_2 = 0;
38596 :
38597 : /* "scipy/linalg/_decomp_update.pyx":2475
38598 : * u1 = PyArray_FromArray(u1, NULL, cnp.NPY_ARRAY_F_CONTIGUOUS)
38599 : * # v.T must be F contiguous --> v must be C contiguous
38600 : * if not cnp.PyArray_CHKFLAGS(v1, cnp.NPY_ARRAY_C_CONTIGUOUS): # <<<<<<<<<<<<<<
38601 : * v1 = PyArray_FromArray(v1, NULL, cnp.NPY_ARRAY_C_CONTIGUOUS)
38602 : * v1 = v1.T
38603 : */
38604 : }
38605 :
38606 : /* "scipy/linalg/_decomp_update.pyx":2477
38607 : * if not cnp.PyArray_CHKFLAGS(v1, cnp.NPY_ARRAY_C_CONTIGUOUS):
38608 : * v1 = PyArray_FromArray(v1, NULL, cnp.NPY_ARRAY_C_CONTIGUOUS)
38609 : * v1 = v1.T # <<<<<<<<<<<<<<
38610 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38611 : * qptr = extract(q1, qs)
38612 : */
38613 844 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_v1), __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2477, __pyx_L1_error)
38614 844 : __Pyx_GOTREF(__pyx_t_2);
38615 844 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2477, __pyx_L1_error)
38616 844 : __Pyx_DECREF_SET(__pyx_v_v1, ((PyArrayObject *)__pyx_t_2));
38617 844 : __pyx_t_2 = 0;
38618 :
38619 : /* "scipy/linalg/_decomp_update.pyx":2478
38620 : * v1 = PyArray_FromArray(v1, NULL, cnp.NPY_ARRAY_C_CONTIGUOUS)
38621 : * v1 = v1.T
38622 : * form_qTu(q1, u1, qTuptr, qTus, 0) # <<<<<<<<<<<<<<
38623 : * qptr = extract(q1, qs)
38624 : * rptr = extract(r1, rs)
38625 : */
38626 844 : __pyx_t_2 = __pyx_f_5scipy_6linalg_14_decomp_update_form_qTu(__pyx_v_q1, __pyx_v_u1, __pyx_v_qTuptr, __pyx_v_qTus, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2478, __pyx_L1_error)
38627 844 : __Pyx_GOTREF(__pyx_t_2);
38628 844 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38629 :
38630 : /* "scipy/linalg/_decomp_update.pyx":2479
38631 : * v1 = v1.T
38632 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38633 : * qptr = extract(q1, qs) # <<<<<<<<<<<<<<
38634 : * rptr = extract(r1, rs)
38635 : * vptr = extract(v1, vs)
38636 : */
38637 844 : __pyx_v_qptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_q1, __pyx_v_qs);
38638 :
38639 : /* "scipy/linalg/_decomp_update.pyx":2480
38640 : * form_qTu(q1, u1, qTuptr, qTus, 0)
38641 : * qptr = extract(q1, qs)
38642 : * rptr = extract(r1, rs) # <<<<<<<<<<<<<<
38643 : * vptr = extract(v1, vs)
38644 : * with nogil:
38645 : */
38646 844 : __pyx_v_rptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_r1, __pyx_v_rs);
38647 :
38648 : /* "scipy/linalg/_decomp_update.pyx":2481
38649 : * qptr = extract(q1, qs)
38650 : * rptr = extract(r1, rs)
38651 : * vptr = extract(v1, vs) # <<<<<<<<<<<<<<
38652 : * with nogil:
38653 : * if typecode == cnp.NPY_FLOAT:
38654 : */
38655 844 : __pyx_v_vptr = __pyx_f_5scipy_6linalg_14_decomp_update_extract(__pyx_v_v1, __pyx_v_vs);
38656 :
38657 : /* "scipy/linalg/_decomp_update.pyx":2482
38658 : * rptr = extract(r1, rs)
38659 : * vptr = extract(v1, vs)
38660 : * with nogil: # <<<<<<<<<<<<<<
38661 : * if typecode == cnp.NPY_FLOAT:
38662 : * info = qr_rank_p_update(m, n, p, <float*>qptr, qs,
38663 : */
38664 : {
38665 : #ifdef WITH_THREAD
38666 844 : PyThreadState *_save;
38667 844 : _save = NULL;
38668 844 : Py_UNBLOCK_THREADS
38669 844 : __Pyx_FastGIL_Remember();
38670 : #endif
38671 : /*try:*/ {
38672 :
38673 : /* "scipy/linalg/_decomp_update.pyx":2483
38674 : * vptr = extract(v1, vs)
38675 : * with nogil:
38676 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
38677 : * info = qr_rank_p_update(m, n, p, <float*>qptr, qs,
38678 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38679 : */
38680 844 : switch (__pyx_v_typecode) {
38681 211 : case NPY_FLOAT:
38682 :
38683 : /* "scipy/linalg/_decomp_update.pyx":2484
38684 : * with nogil:
38685 : * if typecode == cnp.NPY_FLOAT:
38686 : * info = qr_rank_p_update(m, n, p, <float*>qptr, qs, # <<<<<<<<<<<<<<
38687 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38688 : * <float*>vptr, vs)
38689 : */
38690 211 : __pyx_v_info = __pyx_fuse_0__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((float *)__pyx_v_qptr), __pyx_v_qs, ((float *)__pyx_v_rptr), __pyx_v_rs, ((float *)__pyx_v_qTuptr), __pyx_v_qTus, ((float *)__pyx_v_vptr), __pyx_v_vs);
38691 :
38692 : /* "scipy/linalg/_decomp_update.pyx":2483
38693 : * vptr = extract(v1, vs)
38694 : * with nogil:
38695 : * if typecode == cnp.NPY_FLOAT: # <<<<<<<<<<<<<<
38696 : * info = qr_rank_p_update(m, n, p, <float*>qptr, qs,
38697 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38698 : */
38699 211 : break;
38700 211 : case NPY_DOUBLE:
38701 :
38702 : /* "scipy/linalg/_decomp_update.pyx":2488
38703 : * <float*>vptr, vs)
38704 : * elif typecode == cnp.NPY_DOUBLE:
38705 : * info = qr_rank_p_update(m, n, p, <double*>qptr, qs, # <<<<<<<<<<<<<<
38706 : * <double*>rptr, rs, <double*>qTuptr, qTus,
38707 : * <double*>vptr, vs)
38708 : */
38709 211 : __pyx_v_info = __pyx_fuse_1__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((double *)__pyx_v_qptr), __pyx_v_qs, ((double *)__pyx_v_rptr), __pyx_v_rs, ((double *)__pyx_v_qTuptr), __pyx_v_qTus, ((double *)__pyx_v_vptr), __pyx_v_vs);
38710 :
38711 : /* "scipy/linalg/_decomp_update.pyx":2487
38712 : * <float*>rptr, rs, <float*>qTuptr, qTus,
38713 : * <float*>vptr, vs)
38714 : * elif typecode == cnp.NPY_DOUBLE: # <<<<<<<<<<<<<<
38715 : * info = qr_rank_p_update(m, n, p, <double*>qptr, qs,
38716 : * <double*>rptr, rs, <double*>qTuptr, qTus,
38717 : */
38718 211 : break;
38719 211 : case NPY_CFLOAT:
38720 :
38721 : /* "scipy/linalg/_decomp_update.pyx":2492
38722 : * <double*>vptr, vs)
38723 : * elif typecode == cnp.NPY_CFLOAT:
38724 : * info = qr_rank_p_update(m, n, p, <float_complex*>qptr, qs, # <<<<<<<<<<<<<<
38725 : * <float_complex*>rptr, rs, <float_complex*>qTuptr, qTus,
38726 : * <float_complex*>vptr, vs)
38727 : */
38728 211 : __pyx_v_info = __pyx_fuse_2__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((__pyx_t_float_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_float_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_float_complex *)__pyx_v_qTuptr), __pyx_v_qTus, ((__pyx_t_float_complex *)__pyx_v_vptr), __pyx_v_vs);
38729 :
38730 : /* "scipy/linalg/_decomp_update.pyx":2491
38731 : * <double*>rptr, rs, <double*>qTuptr, qTus,
38732 : * <double*>vptr, vs)
38733 : * elif typecode == cnp.NPY_CFLOAT: # <<<<<<<<<<<<<<
38734 : * info = qr_rank_p_update(m, n, p, <float_complex*>qptr, qs,
38735 : * <float_complex*>rptr, rs, <float_complex*>qTuptr, qTus,
38736 : */
38737 211 : break;
38738 211 : default:
38739 :
38740 : /* "scipy/linalg/_decomp_update.pyx":2496
38741 : * <float_complex*>vptr, vs)
38742 : * else: # typecode == cnp.NPY_CDOUBLE:
38743 : * info = qr_rank_p_update(m, n, p, <double_complex*>qptr, qs, # <<<<<<<<<<<<<<
38744 : * <double_complex*>rptr, rs, <double_complex*>qTuptr, qTus,
38745 : * <double_complex*>vptr, vs)
38746 : */
38747 211 : __pyx_v_info = __pyx_fuse_3__pyx_f_5scipy_6linalg_14_decomp_update_qr_rank_p_update(__pyx_v_m, __pyx_v_n, __pyx_v_p, ((__pyx_t_double_complex *)__pyx_v_qptr), __pyx_v_qs, ((__pyx_t_double_complex *)__pyx_v_rptr), __pyx_v_rs, ((__pyx_t_double_complex *)__pyx_v_qTuptr), __pyx_v_qTus, ((__pyx_t_double_complex *)__pyx_v_vptr), __pyx_v_vs);
38748 211 : break;
38749 : }
38750 : }
38751 :
38752 : /* "scipy/linalg/_decomp_update.pyx":2482
38753 : * rptr = extract(r1, rs)
38754 : * vptr = extract(v1, vs)
38755 : * with nogil: # <<<<<<<<<<<<<<
38756 : * if typecode == cnp.NPY_FLOAT:
38757 : * info = qr_rank_p_update(m, n, p, <float*>qptr, qs,
38758 : */
38759 : /*finally:*/ {
38760 : /*normal exit:*/{
38761 : #ifdef WITH_THREAD
38762 844 : __Pyx_FastGIL_Forget();
38763 844 : Py_BLOCK_THREADS
38764 : #endif
38765 844 : goto __pyx_L42;
38766 : }
38767 844 : __pyx_L42:;
38768 : }
38769 : }
38770 :
38771 : /* "scipy/linalg/_decomp_update.pyx":2499
38772 : * <double_complex*>rptr, rs, <double_complex*>qTuptr, qTus,
38773 : * <double_complex*>vptr, vs)
38774 : * if info != 0: # <<<<<<<<<<<<<<
38775 : * if info > 0:
38776 : * raise ValueError('The {0}th argument to ?geqrf was '
38777 : */
38778 844 : __pyx_t_1 = (__pyx_v_info != 0);
38779 844 : if (__pyx_t_1) {
38780 :
38781 : /* "scipy/linalg/_decomp_update.pyx":2500
38782 : * <double_complex*>vptr, vs)
38783 : * if info != 0:
38784 : * if info > 0: # <<<<<<<<<<<<<<
38785 : * raise ValueError('The {0}th argument to ?geqrf was '
38786 : * 'invalid'.format(info))
38787 : */
38788 0 : __pyx_t_1 = (__pyx_v_info > 0);
38789 0 : if (unlikely(__pyx_t_1)) {
38790 :
38791 : /* "scipy/linalg/_decomp_update.pyx":2502
38792 : * if info > 0:
38793 : * raise ValueError('The {0}th argument to ?geqrf was '
38794 : * 'invalid'.format(info)) # <<<<<<<<<<<<<<
38795 : * elif info < 0:
38796 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
38797 : */
38798 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_0_th_argument_to_geqrf_was_i, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2502, __pyx_L1_error)
38799 0 : __Pyx_GOTREF(__pyx_t_7);
38800 0 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_info); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2502, __pyx_L1_error)
38801 0 : __Pyx_GOTREF(__pyx_t_6);
38802 0 : __pyx_t_8 = NULL;
38803 0 : __pyx_t_13 = 0;
38804 : #if CYTHON_UNPACK_METHODS
38805 0 : if (likely(PyMethod_Check(__pyx_t_7))) {
38806 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
38807 0 : if (likely(__pyx_t_8)) {
38808 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
38809 0 : __Pyx_INCREF(__pyx_t_8);
38810 0 : __Pyx_INCREF(function);
38811 0 : __Pyx_DECREF_SET(__pyx_t_7, function);
38812 : __pyx_t_13 = 1;
38813 : }
38814 : }
38815 : #endif
38816 : {
38817 0 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
38818 0 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
38819 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
38820 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
38821 0 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2502, __pyx_L1_error)
38822 0 : __Pyx_GOTREF(__pyx_t_2);
38823 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
38824 : }
38825 :
38826 : /* "scipy/linalg/_decomp_update.pyx":2501
38827 : * if info != 0:
38828 : * if info > 0:
38829 : * raise ValueError('The {0}th argument to ?geqrf was ' # <<<<<<<<<<<<<<
38830 : * 'invalid'.format(info))
38831 : * elif info < 0:
38832 : */
38833 0 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2501, __pyx_L1_error)
38834 0 : __Pyx_GOTREF(__pyx_t_7);
38835 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38836 0 : __Pyx_Raise(__pyx_t_7, 0, 0, 0);
38837 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
38838 0 : __PYX_ERR(0, 2501, __pyx_L1_error)
38839 :
38840 : /* "scipy/linalg/_decomp_update.pyx":2500
38841 : * <double_complex*>vptr, vs)
38842 : * if info != 0:
38843 : * if info > 0: # <<<<<<<<<<<<<<
38844 : * raise ValueError('The {0}th argument to ?geqrf was '
38845 : * 'invalid'.format(info))
38846 : */
38847 : }
38848 :
38849 : /* "scipy/linalg/_decomp_update.pyx":2503
38850 : * raise ValueError('The {0}th argument to ?geqrf was '
38851 : * 'invalid'.format(info))
38852 : * elif info < 0: # <<<<<<<<<<<<<<
38853 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
38854 : * 'invalid'.format(abs(info)))
38855 : */
38856 0 : __pyx_t_1 = (__pyx_v_info < 0);
38857 0 : if (unlikely(__pyx_t_1)) {
38858 :
38859 : /* "scipy/linalg/_decomp_update.pyx":2505
38860 : * elif info < 0:
38861 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
38862 : * 'invalid'.format(abs(info))) # <<<<<<<<<<<<<<
38863 : * elif info == MEMORY_ERROR:
38864 : * raise MemoryError('Unable to allocate memory for array.')
38865 : */
38866 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_The_0_th_argument_to_ormqr_unmqr, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2505, __pyx_L1_error)
38867 0 : __Pyx_GOTREF(__pyx_t_2);
38868 0 : __pyx_t_11 = abs(__pyx_v_info); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 2505, __pyx_L1_error)
38869 0 : __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2505, __pyx_L1_error)
38870 0 : __Pyx_GOTREF(__pyx_t_6);
38871 0 : __pyx_t_8 = NULL;
38872 0 : __pyx_t_13 = 0;
38873 : #if CYTHON_UNPACK_METHODS
38874 0 : if (likely(PyMethod_Check(__pyx_t_2))) {
38875 0 : __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
38876 0 : if (likely(__pyx_t_8)) {
38877 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
38878 0 : __Pyx_INCREF(__pyx_t_8);
38879 0 : __Pyx_INCREF(function);
38880 0 : __Pyx_DECREF_SET(__pyx_t_2, function);
38881 : __pyx_t_13 = 1;
38882 : }
38883 : }
38884 : #endif
38885 : {
38886 0 : PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
38887 0 : __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
38888 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
38889 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
38890 0 : if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2505, __pyx_L1_error)
38891 0 : __Pyx_GOTREF(__pyx_t_7);
38892 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38893 : }
38894 :
38895 : /* "scipy/linalg/_decomp_update.pyx":2504
38896 : * 'invalid'.format(info))
38897 : * elif info < 0:
38898 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was ' # <<<<<<<<<<<<<<
38899 : * 'invalid'.format(abs(info)))
38900 : * elif info == MEMORY_ERROR:
38901 : */
38902 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2504, __pyx_L1_error)
38903 0 : __Pyx_GOTREF(__pyx_t_2);
38904 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
38905 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
38906 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38907 0 : __PYX_ERR(0, 2504, __pyx_L1_error)
38908 :
38909 : /* "scipy/linalg/_decomp_update.pyx":2503
38910 : * raise ValueError('The {0}th argument to ?geqrf was '
38911 : * 'invalid'.format(info))
38912 : * elif info < 0: # <<<<<<<<<<<<<<
38913 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
38914 : * 'invalid'.format(abs(info)))
38915 : */
38916 : }
38917 :
38918 : /* "scipy/linalg/_decomp_update.pyx":2506
38919 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
38920 : * 'invalid'.format(abs(info)))
38921 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
38922 : * raise MemoryError('Unable to allocate memory for array.')
38923 : * return q1, r1
38924 : */
38925 : __pyx_t_1 = (__pyx_v_info == __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR);
38926 : if (unlikely(__pyx_t_1)) {
38927 :
38928 : /* "scipy/linalg/_decomp_update.pyx":2507
38929 : * 'invalid'.format(abs(info)))
38930 : * elif info == MEMORY_ERROR:
38931 : * raise MemoryError('Unable to allocate memory for array.') # <<<<<<<<<<<<<<
38932 : * return q1, r1
38933 : *
38934 : */
38935 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2507, __pyx_L1_error)
38936 : __Pyx_GOTREF(__pyx_t_2);
38937 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
38938 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38939 : __PYX_ERR(0, 2507, __pyx_L1_error)
38940 :
38941 : /* "scipy/linalg/_decomp_update.pyx":2506
38942 : * raise ValueError('The {0}th argument to ?ormqr/?unmqr was '
38943 : * 'invalid'.format(abs(info)))
38944 : * elif info == MEMORY_ERROR: # <<<<<<<<<<<<<<
38945 : * raise MemoryError('Unable to allocate memory for array.')
38946 : * return q1, r1
38947 : */
38948 : }
38949 :
38950 : /* "scipy/linalg/_decomp_update.pyx":2499
38951 : * <double_complex*>rptr, rs, <double_complex*>qTuptr, qTus,
38952 : * <double_complex*>vptr, vs)
38953 : * if info != 0: # <<<<<<<<<<<<<<
38954 : * if info > 0:
38955 : * raise ValueError('The {0}th argument to ?geqrf was '
38956 : */
38957 : }
38958 : }
38959 844 : __pyx_L31:;
38960 : }
38961 2052 : __pyx_L23:;
38962 :
38963 : /* "scipy/linalg/_decomp_update.pyx":2508
38964 : * elif info == MEMORY_ERROR:
38965 : * raise MemoryError('Unable to allocate memory for array.')
38966 : * return q1, r1 # <<<<<<<<<<<<<<
38967 : *
38968 : * cnp.import_array()
38969 : */
38970 2052 : __Pyx_XDECREF(__pyx_r);
38971 2052 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2508, __pyx_L1_error)
38972 2052 : __Pyx_GOTREF(__pyx_t_2);
38973 2052 : __Pyx_INCREF((PyObject *)__pyx_v_q1);
38974 2052 : __Pyx_GIVEREF((PyObject *)__pyx_v_q1);
38975 2052 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_q1))) __PYX_ERR(0, 2508, __pyx_L1_error);
38976 2052 : __Pyx_INCREF((PyObject *)__pyx_v_r1);
38977 2052 : __Pyx_GIVEREF((PyObject *)__pyx_v_r1);
38978 2052 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_r1))) __PYX_ERR(0, 2508, __pyx_L1_error);
38979 2052 : __pyx_r = __pyx_t_2;
38980 2052 : __pyx_t_2 = 0;
38981 2052 : goto __pyx_L0;
38982 :
38983 : /* "scipy/linalg/_decomp_update.pyx":2154
38984 : * return q1, rnew
38985 : *
38986 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
38987 : * def qr_update(Q, R, u, v, overwrite_qruv=False, check_finite=True):
38988 : * """
38989 : */
38990 :
38991 : /* function exit code */
38992 308 : __pyx_L1_error:;
38993 308 : __Pyx_XDECREF(__pyx_t_2);
38994 308 : __Pyx_XDECREF(__pyx_t_3);
38995 308 : __Pyx_XDECREF(__pyx_t_4);
38996 308 : __Pyx_XDECREF(__pyx_t_5);
38997 308 : __Pyx_XDECREF(__pyx_t_6);
38998 308 : __Pyx_XDECREF(__pyx_t_7);
38999 308 : __Pyx_XDECREF(__pyx_t_8);
39000 308 : __Pyx_AddTraceback("scipy.linalg._decomp_update.qr_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
39001 308 : __pyx_r = NULL;
39002 2376 : __pyx_L0:;
39003 2376 : __Pyx_XDECREF((PyObject *)__pyx_v_q1);
39004 2376 : __Pyx_XDECREF((PyObject *)__pyx_v_r1);
39005 2376 : __Pyx_XDECREF((PyObject *)__pyx_v_u1);
39006 2376 : __Pyx_XDECREF((PyObject *)__pyx_v_v1);
39007 2376 : __Pyx_XDECREF((PyObject *)__pyx_v_qTu);
39008 2376 : __Pyx_XDECREF((PyObject *)__pyx_v_s);
39009 2376 : __Pyx_XDECREF(__pyx_v_rnew);
39010 2376 : __Pyx_XGIVEREF(__pyx_r);
39011 2376 : __Pyx_RefNannyFinishContext();
39012 2376 : return __pyx_r;
39013 : }
39014 :
39015 : static PyMethodDef __pyx_methods[] = {
39016 : {0, 0, 0, 0}
39017 : };
39018 : #ifndef CYTHON_SMALL_CODE
39019 : #if defined(__clang__)
39020 : #define CYTHON_SMALL_CODE
39021 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
39022 : #define CYTHON_SMALL_CODE __attribute__((cold))
39023 : #else
39024 : #define CYTHON_SMALL_CODE
39025 : #endif
39026 : #endif
39027 : /* #### Code section: pystring_table ### */
39028 :
39029 3 : static int __Pyx_CreateStringTabAndInitStrings(void) {
39030 3 : __Pyx_StringTabEntry __pyx_string_tab[] = {
39031 3 : {&__pyx_kp_u_Expected_M_M_M_N_or_M_N_N_N_but, __pyx_k_Expected_M_M_M_N_or_M_N_N_N_but, sizeof(__pyx_k_Expected_M_M_M_N_or_M_N_N_N_but), 0, 1, 0, 0},
39032 3 : {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1},
39033 3 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
39034 3 : {&__pyx_kp_u_Input_array_too_large_for_use_wi, __pyx_k_Input_array_too_large_for_use_wi, sizeof(__pyx_k_Input_array_too_large_for_use_wi), 0, 1, 0, 0},
39035 3 : {&__pyx_kp_u_Inputs_must_be_arrays, __pyx_k_Inputs_must_be_arrays, sizeof(__pyx_k_Inputs_must_be_arrays), 0, 1, 0, 0},
39036 3 : {&__pyx_n_s_LinAlgError, __pyx_k_LinAlgError, sizeof(__pyx_k_LinAlgError), 0, 0, 1, 1},
39037 3 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
39038 3 : {&__pyx_kp_u_One_of_the_columns_of_u_lies_in, __pyx_k_One_of_the_columns_of_u_lies_in, sizeof(__pyx_k_One_of_the_columns_of_u_lies_in), 0, 1, 0, 0},
39039 3 : {&__pyx_kp_u_Only_arrays_with_dtypes_float32, __pyx_k_Only_arrays_with_dtypes_float32, sizeof(__pyx_k_Only_arrays_with_dtypes_float32), 0, 1, 0, 0},
39040 3 : {&__pyx_n_s_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 1, 1},
39041 3 : {&__pyx_kp_u_QR_downdate_on_row_or_column_de, __pyx_k_QR_downdate_on_row_or_column_de, sizeof(__pyx_k_QR_downdate_on_row_or_column_de), 0, 1, 0, 0},
39042 3 : {&__pyx_kp_u_QR_update_on_row_or_column_inse, __pyx_k_QR_update_on_row_or_column_inse, sizeof(__pyx_k_QR_update_on_row_or_column_inse), 0, 1, 0, 0},
39043 3 : {&__pyx_kp_u_Q_and_R_do_not_have_compatible_s, __pyx_k_Q_and_R_do_not_have_compatible_s, sizeof(__pyx_k_Q_and_R_do_not_have_compatible_s), 0, 1, 0, 0},
39044 3 : {&__pyx_kp_u_Q_and_R_must_be_2_D, __pyx_k_Q_and_R_must_be_2_D, sizeof(__pyx_k_Q_and_R_must_be_2_D), 0, 1, 0, 0},
39045 3 : {&__pyx_kp_u_Q_and_R_must_have_the_same_dtype, __pyx_k_Q_and_R_must_have_the_same_dtype, sizeof(__pyx_k_Q_and_R_must_have_the_same_dtype), 0, 1, 0, 0},
39046 3 : {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
39047 3 : {&__pyx_kp_u_Rank_k_QR_update_If_A_Q_R_is_th, __pyx_k_Rank_k_QR_update_If_A_Q_R_is_th, sizeof(__pyx_k_Rank_k_QR_update_If_A_Q_R_is_th), 0, 1, 0, 0},
39048 3 : {&__pyx_kp_u_Reorthogonalization_Failed_unabl, __pyx_k_Reorthogonalization_Failed_unabl, sizeof(__pyx_k_Reorthogonalization_Failed_unabl), 0, 1, 0, 0},
39049 3 : {&__pyx_kp_u_Second_dimension_of_u_and_v_must, __pyx_k_Second_dimension_of_u_and_v_must, sizeof(__pyx_k_Second_dimension_of_u_and_v_must), 0, 1, 0, 0},
39050 3 : {&__pyx_kp_u_Shape_of_u_is_incorrect_should_b, __pyx_k_Shape_of_u_is_incorrect_should_b, sizeof(__pyx_k_Shape_of_u_is_incorrect_should_b), 0, 1, 0, 0},
39051 3 : {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
39052 3 : {&__pyx_kp_u_The_0_th_argument_to_geqrf_was_i, __pyx_k_The_0_th_argument_to_geqrf_was_i, sizeof(__pyx_k_The_0_th_argument_to_geqrf_was_i), 0, 1, 0, 0},
39053 3 : {&__pyx_kp_u_The_0_th_argument_to_ormqr_unmqr, __pyx_k_The_0_th_argument_to_ormqr_unmqr, sizeof(__pyx_k_The_0_th_argument_to_ormqr_unmqr), 0, 1, 0, 0},
39054 3 : {&__pyx_kp_u_Unable_to_allocate_memory_for_ar, __pyx_k_Unable_to_allocate_memory_for_ar, sizeof(__pyx_k_Unable_to_allocate_memory_for_ar), 0, 1, 0, 0},
39055 3 : {&__pyx_kp_u_Unable_to_allocate_memory_for_ar_2, __pyx_k_Unable_to_allocate_memory_for_ar_2, sizeof(__pyx_k_Unable_to_allocate_memory_for_ar_2), 0, 1, 0, 0},
39056 3 : {&__pyx_kp_u_Update_rank_larger_than_np_dot_Q, __pyx_k_Update_rank_larger_than_np_dot_Q, sizeof(__pyx_k_Update_rank_larger_than_np_dot_Q), 0, 1, 0, 0},
39057 3 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
39058 3 : {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
39059 3 : {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0},
39060 3 : {&__pyx_n_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 1},
39061 3 : {&__pyx_n_s__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 1, 1},
39062 3 : {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
39063 3 : {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
39064 3 : {&__pyx_n_s_all_2, __pyx_k_all_2, sizeof(__pyx_k_all_2), 0, 0, 1, 1},
39065 3 : {&__pyx_kp_u_array_must_not_contain_infs_or_N, __pyx_k_array_must_not_contain_infs_or_N, sizeof(__pyx_k_array_must_not_contain_infs_or_N), 0, 1, 0, 0},
39066 3 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
39067 3 : {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
39068 3 : {&__pyx_n_s_check_finite, __pyx_k_check_finite, sizeof(__pyx_k_check_finite), 0, 0, 1, 1},
39069 3 : {&__pyx_n_s_chkfinite, __pyx_k_chkfinite, sizeof(__pyx_k_chkfinite), 0, 0, 1, 1},
39070 3 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
39071 3 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
39072 3 : {&__pyx_n_u_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 1, 0, 1},
39073 3 : {&__pyx_n_s_conj, __pyx_k_conj, sizeof(__pyx_k_conj), 0, 0, 1, 1},
39074 3 : {&__pyx_n_s_conjugate, __pyx_k_conjugate, sizeof(__pyx_k_conjugate), 0, 0, 1, 1},
39075 3 : {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
39076 3 : {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
39077 3 : {&__pyx_n_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1},
39078 3 : {&__pyx_n_s_economic, __pyx_k_economic, sizeof(__pyx_k_economic), 0, 0, 1, 1},
39079 3 : {&__pyx_kp_u_for_Q_and_R_respectively, __pyx_k_for_Q_and_R_respectively, sizeof(__pyx_k_for_Q_and_R_respectively), 0, 1, 0, 0},
39080 3 : {&__pyx_n_s_form_qTu, __pyx_k_form_qTu, sizeof(__pyx_k_form_qTu), 0, 0, 1, 1},
39081 3 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
39082 3 : {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
39083 3 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
39084 3 : {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
39085 3 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
39086 3 : {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
39087 3 : {&__pyx_n_s_intp, __pyx_k_intp, sizeof(__pyx_k_intp), 0, 0, 1, 1},
39088 3 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
39089 3 : {&__pyx_n_s_isfinite, __pyx_k_isfinite, sizeof(__pyx_k_isfinite), 0, 0, 1, 1},
39090 3 : {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
39091 3 : {&__pyx_n_s_k1, __pyx_k_k1, sizeof(__pyx_k_k1), 0, 0, 1, 1},
39092 3 : {&__pyx_kp_u_k_is_out_of_bounds, __pyx_k_k_is_out_of_bounds, sizeof(__pyx_k_k_is_out_of_bounds), 0, 1, 0, 0},
39093 3 : {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
39094 3 : {&__pyx_n_s_linalg, __pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 0, 1, 1},
39095 3 : {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
39096 3 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
39097 3 : {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
39098 3 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
39099 3 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
39100 3 : {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1},
39101 3 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
39102 3 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
39103 3 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
39104 3 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
39105 3 : {&__pyx_n_s_numpy_linalg, __pyx_k_numpy_linalg, sizeof(__pyx_k_numpy_linalg), 0, 0, 1, 1},
39106 3 : {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1},
39107 3 : {&__pyx_n_s_overwrite, __pyx_k_overwrite, sizeof(__pyx_k_overwrite), 0, 0, 1, 1},
39108 3 : {&__pyx_n_s_overwrite_qr, __pyx_k_overwrite_qr, sizeof(__pyx_k_overwrite_qr), 0, 0, 1, 1},
39109 3 : {&__pyx_n_s_overwrite_qru, __pyx_k_overwrite_qru, sizeof(__pyx_k_overwrite_qru), 0, 0, 1, 1},
39110 3 : {&__pyx_n_s_overwrite_qruv, __pyx_k_overwrite_qruv, sizeof(__pyx_k_overwrite_qruv), 0, 0, 1, 1},
39111 3 : {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
39112 3 : {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
39113 3 : {&__pyx_n_s_p_eco, __pyx_k_p_eco, sizeof(__pyx_k_p_eco), 0, 0, 1, 1},
39114 3 : {&__pyx_n_s_p_full, __pyx_k_p_full, sizeof(__pyx_k_p_full), 0, 0, 1, 1},
39115 3 : {&__pyx_kp_u_p_is_out_of_range, __pyx_k_p_is_out_of_range, sizeof(__pyx_k_p_is_out_of_range), 0, 1, 0, 0},
39116 3 : {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1},
39117 3 : {&__pyx_n_s_q1, __pyx_k_q1, sizeof(__pyx_k_q1), 0, 0, 1, 1},
39118 3 : {&__pyx_n_s_qTu, __pyx_k_qTu, sizeof(__pyx_k_qTu), 0, 0, 1, 1},
39119 3 : {&__pyx_n_s_qTuptr, __pyx_k_qTuptr, sizeof(__pyx_k_qTuptr), 0, 0, 1, 1},
39120 3 : {&__pyx_n_s_qTus, __pyx_k_qTus, sizeof(__pyx_k_qTus), 0, 0, 1, 1},
39121 3 : {&__pyx_n_s_qTuvoid, __pyx_k_qTuvoid, sizeof(__pyx_k_qTuvoid), 0, 0, 1, 1},
39122 3 : {&__pyx_kp_u_q_and_u_must_be_a_blas_compatibl, __pyx_k_q_and_u_must_be_a_blas_compatibl, sizeof(__pyx_k_q_and_u_must_be_a_blas_compatibl), 0, 1, 0, 0},
39123 3 : {&__pyx_kp_u_q_and_u_must_have_the_same_type, __pyx_k_q_and_u_must_have_the_same_type, sizeof(__pyx_k_q_and_u_must_have_the_same_type), 0, 1, 0, 0},
39124 3 : {&__pyx_kp_u_q_must_be_either_F_or_C_contiguo, __pyx_k_q_must_be_either_F_or_C_contiguo, sizeof(__pyx_k_q_must_be_either_F_or_C_contiguo), 0, 1, 0, 0},
39125 3 : {&__pyx_n_s_qisF, __pyx_k_qisF, sizeof(__pyx_k_qisF), 0, 0, 1, 1},
39126 3 : {&__pyx_n_s_qnew, __pyx_k_qnew, sizeof(__pyx_k_qnew), 0, 0, 1, 1},
39127 3 : {&__pyx_n_s_qptr, __pyx_k_qptr, sizeof(__pyx_k_qptr), 0, 0, 1, 1},
39128 3 : {&__pyx_n_s_qr_delete, __pyx_k_qr_delete, sizeof(__pyx_k_qr_delete), 0, 0, 1, 1},
39129 3 : {&__pyx_n_u_qr_delete, __pyx_k_qr_delete, sizeof(__pyx_k_qr_delete), 0, 1, 0, 1},
39130 3 : {&__pyx_kp_u_qr_delete_line_1444, __pyx_k_qr_delete_line_1444, sizeof(__pyx_k_qr_delete_line_1444), 0, 1, 0, 0},
39131 3 : {&__pyx_n_s_qr_insert, __pyx_k_qr_insert, sizeof(__pyx_k_qr_insert), 0, 0, 1, 1},
39132 3 : {&__pyx_n_u_qr_insert, __pyx_k_qr_insert, sizeof(__pyx_k_qr_insert), 0, 1, 0, 1},
39133 3 : {&__pyx_kp_u_qr_insert_line_1689, __pyx_k_qr_insert_line_1689, sizeof(__pyx_k_qr_insert_line_1689), 0, 1, 0, 0},
39134 3 : {&__pyx_n_s_qr_update, __pyx_k_qr_update, sizeof(__pyx_k_qr_update), 0, 0, 1, 1},
39135 3 : {&__pyx_n_u_qr_update, __pyx_k_qr_update, sizeof(__pyx_k_qr_update), 0, 1, 0, 1},
39136 3 : {&__pyx_kp_u_qr_update_line_2154, __pyx_k_qr_update_line_2154, sizeof(__pyx_k_qr_update_line_2154), 0, 1, 0, 0},
39137 3 : {&__pyx_n_s_qs, __pyx_k_qs, sizeof(__pyx_k_qs), 0, 0, 1, 1},
39138 3 : {&__pyx_n_s_r1, __pyx_k_r1, sizeof(__pyx_k_r1), 0, 0, 1, 1},
39139 3 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
39140 3 : {&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
39141 3 : {&__pyx_n_s_rcond, __pyx_k_rcond, sizeof(__pyx_k_rcond), 0, 0, 1, 1},
39142 3 : {&__pyx_kp_u_rcond_is_not_used_when_updating, __pyx_k_rcond_is_not_used_when_updating, sizeof(__pyx_k_rcond_is_not_used_when_updating), 0, 1, 0, 0},
39143 3 : {&__pyx_kp_u_rcond_is_unused_when_inserting, __pyx_k_rcond_is_unused_when_inserting, sizeof(__pyx_k_rcond_is_unused_when_inserting), 0, 1, 0, 0},
39144 3 : {&__pyx_n_s_rnew, __pyx_k_rnew, sizeof(__pyx_k_rnew), 0, 0, 1, 1},
39145 3 : {&__pyx_n_u_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 1, 0, 1},
39146 3 : {&__pyx_n_s_rptr, __pyx_k_rptr, sizeof(__pyx_k_rptr), 0, 0, 1, 1},
39147 3 : {&__pyx_n_s_rs, __pyx_k_rs, sizeof(__pyx_k_rs), 0, 0, 1, 1},
39148 3 : {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
39149 3 : {&__pyx_n_s_scipy_linalg__decomp_update, __pyx_k_scipy_linalg__decomp_update, sizeof(__pyx_k_scipy_linalg__decomp_update), 0, 0, 1, 1},
39150 3 : {&__pyx_kp_s_scipy_linalg__decomp_update_pyx, __pyx_k_scipy_linalg__decomp_update_pyx, sizeof(__pyx_k_scipy_linalg__decomp_update_pyx), 0, 0, 1, 0},
39151 3 : {&__pyx_n_u_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 1, 0, 1},
39152 3 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
39153 3 : {&__pyx_n_s_sptr, __pyx_k_sptr, sizeof(__pyx_k_sptr), 0, 0, 1, 1},
39154 3 : {&__pyx_n_s_ss, __pyx_k_ss, sizeof(__pyx_k_ss), 0, 0, 1, 1},
39155 3 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
39156 3 : {&__pyx_n_s_typecode, __pyx_k_typecode, sizeof(__pyx_k_typecode), 0, 0, 1, 1},
39157 3 : {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
39158 3 : {&__pyx_n_s_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1},
39159 3 : {&__pyx_kp_u_u_and_v_must_have_the_same_numbe, __pyx_k_u_and_v_must_have_the_same_numbe, sizeof(__pyx_k_u_and_v_must_have_the_same_numbe), 0, 1, 0, 0},
39160 3 : {&__pyx_kp_u_u_and_v_must_have_the_same_type, __pyx_k_u_and_v_must_have_the_same_type, sizeof(__pyx_k_u_and_v_must_have_the_same_type), 0, 1, 0, 0},
39161 3 : {&__pyx_kp_u_u_must_be_either_1_or_2_D, __pyx_k_u_must_be_either_1_or_2_D, sizeof(__pyx_k_u_must_be_either_1_or_2_D), 0, 1, 0, 0},
39162 3 : {&__pyx_kp_u_u_must_be_either_1_or_2_D_2, __pyx_k_u_must_be_either_1_or_2_D_2, sizeof(__pyx_k_u_must_be_either_1_or_2_D_2), 0, 1, 0, 0},
39163 3 : {&__pyx_kp_u_u_must_have_the_same_type_as_Q, __pyx_k_u_must_have_the_same_type_as_Q, sizeof(__pyx_k_u_must_have_the_same_type_as_Q), 0, 1, 0, 0},
39164 3 : {&__pyx_kp_u_u_must_have_the_same_type_as_Q_2, __pyx_k_u_must_have_the_same_type_as_Q_2, sizeof(__pyx_k_u_must_have_the_same_type_as_Q_2), 0, 1, 0, 0},
39165 3 : {&__pyx_kp_u_u_shape_0_must_equal_Q_shape_0, __pyx_k_u_shape_0_must_equal_Q_shape_0, sizeof(__pyx_k_u_shape_0_must_equal_Q_shape_0), 0, 1, 0, 0},
39166 3 : {&__pyx_kp_u_u_should_be_either_M_or_M_p_whe, __pyx_k_u_should_be_either_M_or_M_p_whe, sizeof(__pyx_k_u_should_be_either_M_or_M_p_whe), 0, 1, 0, 0},
39167 3 : {&__pyx_kp_u_u_should_be_either_N_or_p_N_whe, __pyx_k_u_should_be_either_N_or_p_N_whe, sizeof(__pyx_k_u_should_be_either_N_or_p_N_whe), 0, 1, 0, 0},
39168 3 : {&__pyx_n_s_uptr, __pyx_k_uptr, sizeof(__pyx_k_uptr), 0, 0, 1, 1},
39169 3 : {&__pyx_n_s_us, __pyx_k_us, sizeof(__pyx_k_us), 0, 0, 1, 1},
39170 3 : {&__pyx_n_s_uv_flags, __pyx_k_uv_flags, sizeof(__pyx_k_uv_flags), 0, 0, 1, 1},
39171 3 : {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
39172 3 : {&__pyx_n_s_v1, __pyx_k_v1, sizeof(__pyx_k_v1), 0, 0, 1, 1},
39173 3 : {&__pyx_kp_u_v_must_be_either_1_or_2_D, __pyx_k_v_must_be_either_1_or_2_D, sizeof(__pyx_k_v_must_be_either_1_or_2_D), 0, 1, 0, 0},
39174 3 : {&__pyx_kp_u_v_shape_0_must_equal_R_shape_1, __pyx_k_v_shape_0_must_equal_R_shape_1, sizeof(__pyx_k_v_shape_0_must_equal_R_shape_1), 0, 1, 0, 0},
39175 3 : {&__pyx_n_s_vptr, __pyx_k_vptr, sizeof(__pyx_k_vptr), 0, 0, 1, 1},
39176 3 : {&__pyx_n_s_vs, __pyx_k_vs, sizeof(__pyx_k_vs), 0, 0, 1, 1},
39177 3 : {&__pyx_n_s_which, __pyx_k_which, sizeof(__pyx_k_which), 0, 0, 1, 1},
39178 3 : {&__pyx_kp_u_which_must_be_either_row_or_col, __pyx_k_which_must_be_either_row_or_col, sizeof(__pyx_k_which_must_be_either_row_or_col), 0, 1, 0, 0},
39179 : {0, 0, 0, 0, 0, 0, 0}
39180 : };
39181 3 : return __Pyx_InitStrings(__pyx_string_tab);
39182 : }
39183 : /* #### Code section: cached_builtins ### */
39184 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
39185 3 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 284, __pyx_L1_error)
39186 3 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 1206, __pyx_L1_error)
39187 3 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 1612, __pyx_L1_error)
39188 3 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1025, __pyx_L1_error)
39189 : return 0;
39190 : __pyx_L1_error:;
39191 : return -1;
39192 : }
39193 : /* #### Code section: cached_constants ### */
39194 :
39195 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
39196 : __Pyx_RefNannyDeclarations
39197 3 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
39198 :
39199 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
39200 : * __pyx_import_array()
39201 : * except Exception:
39202 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
39203 : *
39204 : * cdef inline int import_umath() except -1:
39205 : */
39206 3 : __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 1025, __pyx_L1_error)
39207 3 : __Pyx_GOTREF(__pyx_tuple_);
39208 3 : __Pyx_GIVEREF(__pyx_tuple_);
39209 :
39210 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
39211 : * _import_umath()
39212 : * except Exception:
39213 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
39214 : *
39215 : * cdef inline int import_ufunc() except -1:
39216 : */
39217 3 : __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 1031, __pyx_L1_error)
39218 3 : __Pyx_GOTREF(__pyx_tuple__2);
39219 3 : __Pyx_GIVEREF(__pyx_tuple__2);
39220 :
39221 : /* "scipy/linalg/_decomp_update.pyx":1206
39222 : *
39223 : * if not cnp.PyArray_Check(a) or not cnp.PyArray_Check(b):
39224 : * raise ValueError('Inputs must be arrays') # <<<<<<<<<<<<<<
39225 : *
39226 : * q = a
39227 : */
39228 3 : __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Inputs_must_be_arrays); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 1206, __pyx_L1_error)
39229 3 : __Pyx_GOTREF(__pyx_tuple__3);
39230 3 : __Pyx_GIVEREF(__pyx_tuple__3);
39231 :
39232 : /* "scipy/linalg/_decomp_update.pyx":1213
39233 : * typecode = cnp.PyArray_TYPE(q)
39234 : * if cnp.PyArray_TYPE(u) != typecode:
39235 : * raise ValueError('q and u must have the same type.') # <<<<<<<<<<<<<<
39236 : *
39237 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \
39238 : */
39239 3 : __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_q_and_u_must_have_the_same_type); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 1213, __pyx_L1_error)
39240 3 : __Pyx_GOTREF(__pyx_tuple__4);
39241 3 : __Pyx_GIVEREF(__pyx_tuple__4);
39242 :
39243 : /* "scipy/linalg/_decomp_update.pyx":1217
39244 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE \
39245 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
39246 : * raise ValueError('q and u must be a blas compatible type: f d F or D') # <<<<<<<<<<<<<<
39247 : *
39248 : * q = validate_array(q, True)
39249 : */
39250 3 : __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_q_and_u_must_be_a_blas_compatibl); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1217, __pyx_L1_error)
39251 3 : __Pyx_GOTREF(__pyx_tuple__5);
39252 3 : __Pyx_GIVEREF(__pyx_tuple__5);
39253 :
39254 : /* "scipy/linalg/_decomp_update.pyx":1354
39255 : * blas_t_2d_conj(m, p, col(<double_complex*>qTuvoid, qTus, k), qTus)
39256 : * else:
39257 : * raise ValueError('Shape of u is incorrect, should be 1 <= u.ndim <= 2') # <<<<<<<<<<<<<<
39258 : * else:
39259 : * raise ValueError('q must be either F or C contiguous')
39260 : */
39261 3 : __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Shape_of_u_is_incorrect_should_b); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1354, __pyx_L1_error)
39262 3 : __Pyx_GOTREF(__pyx_tuple__6);
39263 3 : __Pyx_GIVEREF(__pyx_tuple__6);
39264 :
39265 : /* "scipy/linalg/_decomp_update.pyx":1356
39266 : * raise ValueError('Shape of u is incorrect, should be 1 <= u.ndim <= 2')
39267 : * else:
39268 : * raise ValueError('q must be either F or C contiguous') # <<<<<<<<<<<<<<
39269 : *
39270 : * cdef validate_array(cnp.ndarray a, bint chkfinite):
39271 : */
39272 3 : __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_q_must_be_either_F_or_C_contiguo); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1356, __pyx_L1_error)
39273 3 : __Pyx_GOTREF(__pyx_tuple__7);
39274 3 : __Pyx_GIVEREF(__pyx_tuple__7);
39275 :
39276 : /* "scipy/linalg/_decomp_update.pyx":1370
39277 : * copy = True
39278 : * if a.shape[j] >= libc.limits.INT_MAX:
39279 : * raise ValueError('Input array too large for use with BLAS') # <<<<<<<<<<<<<<
39280 : *
39281 : * if chkfinite:
39282 : */
39283 3 : __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Input_array_too_large_for_use_wi); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1370, __pyx_L1_error)
39284 3 : __Pyx_GOTREF(__pyx_tuple__8);
39285 3 : __Pyx_GIVEREF(__pyx_tuple__8);
39286 :
39287 : /* "scipy/linalg/_decomp_update.pyx":1374
39288 : * if chkfinite:
39289 : * if not np.isfinite(a).all():
39290 : * raise ValueError('array must not contain infs or NaNs') # <<<<<<<<<<<<<<
39291 : *
39292 : * if copy:
39293 : */
39294 3 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_array_must_not_contain_infs_or_N); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1374, __pyx_L1_error)
39295 3 : __Pyx_GOTREF(__pyx_tuple__9);
39296 3 : __Pyx_GIVEREF(__pyx_tuple__9);
39297 :
39298 : /* "scipy/linalg/_decomp_update.pyx":1402
39299 : *
39300 : * if Q.ndim != 2 or R.ndim != 2:
39301 : * raise ValueError('Q and R must be 2-D') # <<<<<<<<<<<<<<
39302 : *
39303 : * typecode = cnp.PyArray_TYPE(Q)
39304 : */
39305 3 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Q_and_R_must_be_2_D); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1402, __pyx_L1_error)
39306 3 : __Pyx_GOTREF(__pyx_tuple__10);
39307 3 : __Pyx_GIVEREF(__pyx_tuple__10);
39308 :
39309 : /* "scipy/linalg/_decomp_update.pyx":1407
39310 : *
39311 : * if typecode != cnp.PyArray_TYPE(R):
39312 : * raise ValueError('Q and R must have the same dtype') # <<<<<<<<<<<<<<
39313 : *
39314 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE
39315 : */
39316 3 : __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Q_and_R_must_have_the_same_dtype); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 1407, __pyx_L1_error)
39317 3 : __Pyx_GOTREF(__pyx_tuple__11);
39318 3 : __Pyx_GIVEREF(__pyx_tuple__11);
39319 :
39320 : /* "scipy/linalg/_decomp_update.pyx":1411
39321 : * if not (typecode == cnp.NPY_FLOAT or typecode == cnp.NPY_DOUBLE
39322 : * or typecode == cnp.NPY_CFLOAT or typecode == cnp.NPY_CDOUBLE):
39323 : * raise ValueError('Only arrays with dtypes float32, float64, ' # <<<<<<<<<<<<<<
39324 : * 'complex64, and complex128 are supported.')
39325 : *
39326 : */
39327 3 : __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Only_arrays_with_dtypes_float32); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1411, __pyx_L1_error)
39328 3 : __Pyx_GOTREF(__pyx_tuple__12);
39329 3 : __Pyx_GIVEREF(__pyx_tuple__12);
39330 :
39331 : /* "scipy/linalg/_decomp_update.pyx":1570
39332 : * ARRAY_ANYORDER, overwrite, ARRAY_ANYORDER, chkfinite)
39333 : * if not (-m <= k1 < m):
39334 : * raise ValueError("'k' is out of bounds") # <<<<<<<<<<<<<<
39335 : * if k1 < 0:
39336 : * k1 += m
39337 : */
39338 3 : __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_k_is_out_of_bounds); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1570, __pyx_L1_error)
39339 3 : __Pyx_GOTREF(__pyx_tuple__14);
39340 3 : __Pyx_GIVEREF(__pyx_tuple__14);
39341 :
39342 : /* "scipy/linalg/_decomp_update.pyx":1574
39343 : * k1 += m
39344 : * if k1 + p1 > m or p1 <= 0:
39345 : * raise ValueError("'p' is out of range") # <<<<<<<<<<<<<<
39346 : * if economic:
39347 : * # handle the special case of (M,1), (1,1)
39348 : */
39349 3 : __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_p_is_out_of_range); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1574, __pyx_L1_error)
39350 3 : __Pyx_GOTREF(__pyx_tuple__15);
39351 3 : __Pyx_GIVEREF(__pyx_tuple__15);
39352 :
39353 : /* "scipy/linalg/_decomp_update.pyx":1610
39354 : * <double_complex*>rptr, rs, k1, p_eco, p_full)
39355 : * if info == 1:
39356 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:] # <<<<<<<<<<<<<<
39357 : * elif info == MEMORY_ERROR:
39358 : * raise MemoryError('Unable to allocate memory for array.')
39359 : */
39360 3 : __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 1610, __pyx_L1_error)
39361 3 : __Pyx_GOTREF(__pyx_slice__16);
39362 3 : __Pyx_GIVEREF(__pyx_slice__16);
39363 :
39364 : /* "scipy/linalg/_decomp_update.pyx":1612
39365 : * return q1[p_full:-p_eco, p_full:], r1[p_full:,:]
39366 : * elif info == MEMORY_ERROR:
39367 : * raise MemoryError('Unable to allocate memory for array.') # <<<<<<<<<<<<<<
39368 : * else:
39369 : * raise ValueError('Reorthogonalization Failed, unable to perform row deletion.')
39370 : */
39371 3 : __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Unable_to_allocate_memory_for_ar); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1612, __pyx_L1_error)
39372 3 : __Pyx_GOTREF(__pyx_tuple__17);
39373 3 : __Pyx_GIVEREF(__pyx_tuple__17);
39374 :
39375 : /* "scipy/linalg/_decomp_update.pyx":1614
39376 : * raise MemoryError('Unable to allocate memory for array.')
39377 : * else:
39378 : * raise ValueError('Reorthogonalization Failed, unable to perform row deletion.') # <<<<<<<<<<<<<<
39379 : * else:
39380 : * qptr = extract(q1, qs)
39381 : */
39382 3 : __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Reorthogonalization_Failed_unabl); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1614, __pyx_L1_error)
39383 3 : __Pyx_GOTREF(__pyx_tuple__18);
39384 3 : __Pyx_GIVEREF(__pyx_tuple__18);
39385 :
39386 : /* "scipy/linalg/_decomp_update.pyx":1681
39387 : * <double_complex*>rptr, rs, k1, p1)
39388 : * if info == MEMORY_ERROR:
39389 : * raise MemoryError('Unable to allocate memory for array') # <<<<<<<<<<<<<<
39390 : * if economic:
39391 : * return q1[:, :-p], r1[:-p, :-p]
39392 : */
39393 3 : __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Unable_to_allocate_memory_for_ar_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1681, __pyx_L1_error)
39394 3 : __Pyx_GOTREF(__pyx_tuple__19);
39395 3 : __Pyx_GIVEREF(__pyx_tuple__19);
39396 :
39397 : /* "scipy/linalg/_decomp_update.pyx":1687
39398 : * return q1, r1[:, :-p]
39399 : * else:
39400 : * raise ValueError("'which' must be either 'row' or 'col'") # <<<<<<<<<<<<<<
39401 : *
39402 : * @cython.embedsignature(True)
39403 : */
39404 3 : __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_which_must_be_either_row_or_col); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1687, __pyx_L1_error)
39405 3 : __Pyx_GOTREF(__pyx_tuple__20);
39406 3 : __Pyx_GIVEREF(__pyx_tuple__20);
39407 :
39408 : /* "scipy/linalg/_decomp_update.pyx":1823
39409 : * if which == 'row':
39410 : * if rcond is not None:
39411 : * raise ValueError("'rcond' is unused when inserting rows and " # <<<<<<<<<<<<<<
39412 : * "must be None")
39413 : * return qr_insert_row(Q, R, u, k1, overwrite, chkfinite)
39414 : */
39415 3 : __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_u_rcond_is_unused_when_inserting); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1823, __pyx_L1_error)
39416 3 : __Pyx_GOTREF(__pyx_tuple__21);
39417 3 : __Pyx_GIVEREF(__pyx_tuple__21);
39418 :
39419 : /* "scipy/linalg/_decomp_update.pyx":1855
39420 : *
39421 : * if cnp.PyArray_TYPE(u1) != typecode:
39422 : * raise ValueError("'u' must have the same type as 'Q' and 'R'") # <<<<<<<<<<<<<<
39423 : *
39424 : * if not (-m <= k <= m):
39425 : */
39426 3 : __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_u_must_have_the_same_type_as_Q); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1855, __pyx_L1_error)
39427 3 : __Pyx_GOTREF(__pyx_tuple__22);
39428 3 : __Pyx_GIVEREF(__pyx_tuple__22);
39429 :
39430 : /* "scipy/linalg/_decomp_update.pyx":1876
39431 : * str(getattr(u1, 'shape')))
39432 : * else:
39433 : * raise ValueError("'u' must be either 1- or 2-D") # <<<<<<<<<<<<<<
39434 : *
39435 : * u1 = validate_array(u1, check_finite)
39436 : */
39437 3 : __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_u_must_be_either_1_or_2_D); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1876, __pyx_L1_error)
39438 3 : __Pyx_GOTREF(__pyx_tuple__23);
39439 3 : __Pyx_GIVEREF(__pyx_tuple__23);
39440 :
39441 : /* "scipy/linalg/_decomp_update.pyx":2010
39442 : *
39443 : * if cnp.PyArray_TYPE(u1) != typecode:
39444 : * raise ValueError("'u' must have the same type as Q and R") # <<<<<<<<<<<<<<
39445 : * if not (-n <= k <= n):
39446 : * raise ValueError("'k' is out of bounds")
39447 : */
39448 3 : __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_u_must_have_the_same_type_as_Q_2); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 2010, __pyx_L1_error)
39449 3 : __Pyx_GOTREF(__pyx_tuple__24);
39450 3 : __Pyx_GIVEREF(__pyx_tuple__24);
39451 :
39452 : /* "scipy/linalg/_decomp_update.pyx":2037
39453 : * frc = rcond
39454 : * elif rcond is not None:
39455 : * raise ValueError("'rcond' is not used when updating full, (M,M) (M,N) " # <<<<<<<<<<<<<<
39456 : * "decompositions and must be None.")
39457 : *
39458 : */
39459 3 : __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_rcond_is_not_used_when_updating); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2037, __pyx_L1_error)
39460 3 : __Pyx_GOTREF(__pyx_tuple__25);
39461 3 : __Pyx_GIVEREF(__pyx_tuple__25);
39462 :
39463 : /* "scipy/linalg/_decomp_update.pyx":2339
39464 : *
39465 : * if cnp.PyArray_TYPE(u1) != typecode or cnp.PyArray_TYPE(v1) != typecode:
39466 : * raise ValueError('u and v must have the same type as Q and R') # <<<<<<<<<<<<<<
39467 : *
39468 : * if u1.ndim < 1 or u1.ndim > 2:
39469 : */
39470 3 : __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_u_and_v_must_have_the_same_type); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2339, __pyx_L1_error)
39471 3 : __Pyx_GOTREF(__pyx_tuple__26);
39472 3 : __Pyx_GIVEREF(__pyx_tuple__26);
39473 :
39474 : /* "scipy/linalg/_decomp_update.pyx":2342
39475 : *
39476 : * if u1.ndim < 1 or u1.ndim > 2:
39477 : * raise ValueError('u must be either 1- or 2-D.') # <<<<<<<<<<<<<<
39478 : *
39479 : * if v1.ndim < 1 or v1.ndim > 2:
39480 : */
39481 3 : __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_u_must_be_either_1_or_2_D_2); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2342, __pyx_L1_error)
39482 3 : __Pyx_GOTREF(__pyx_tuple__27);
39483 3 : __Pyx_GIVEREF(__pyx_tuple__27);
39484 :
39485 : /* "scipy/linalg/_decomp_update.pyx":2345
39486 : *
39487 : * if v1.ndim < 1 or v1.ndim > 2:
39488 : * raise ValueError('v must be either 1- or 2-D.') # <<<<<<<<<<<<<<
39489 : *
39490 : * if u1.shape[0] != m:
39491 : */
39492 3 : __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_v_must_be_either_1_or_2_D); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2345, __pyx_L1_error)
39493 3 : __Pyx_GOTREF(__pyx_tuple__28);
39494 3 : __Pyx_GIVEREF(__pyx_tuple__28);
39495 :
39496 : /* "scipy/linalg/_decomp_update.pyx":2348
39497 : *
39498 : * if u1.shape[0] != m:
39499 : * raise ValueError('u.shape[0] must equal Q.shape[0]') # <<<<<<<<<<<<<<
39500 : *
39501 : * if v1.shape[0] != n:
39502 : */
39503 3 : __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_u_shape_0_must_equal_Q_shape_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2348, __pyx_L1_error)
39504 3 : __Pyx_GOTREF(__pyx_tuple__29);
39505 3 : __Pyx_GIVEREF(__pyx_tuple__29);
39506 :
39507 : /* "scipy/linalg/_decomp_update.pyx":2351
39508 : *
39509 : * if v1.shape[0] != n:
39510 : * raise ValueError('v.shape[0] must equal R.shape[1]') # <<<<<<<<<<<<<<
39511 : *
39512 : * if u1.ndim != v1.ndim:
39513 : */
39514 3 : __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_v_shape_0_must_equal_R_shape_1); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2351, __pyx_L1_error)
39515 3 : __Pyx_GOTREF(__pyx_tuple__30);
39516 3 : __Pyx_GIVEREF(__pyx_tuple__30);
39517 :
39518 : /* "scipy/linalg/_decomp_update.pyx":2354
39519 : *
39520 : * if u1.ndim != v1.ndim:
39521 : * raise ValueError('u and v must have the same number of dimensions') # <<<<<<<<<<<<<<
39522 : *
39523 : * if u1.ndim == 2:
39524 : */
39525 3 : __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_u_and_v_must_have_the_same_numbe); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2354, __pyx_L1_error)
39526 3 : __Pyx_GOTREF(__pyx_tuple__31);
39527 3 : __Pyx_GIVEREF(__pyx_tuple__31);
39528 :
39529 : /* "scipy/linalg/_decomp_update.pyx":2358
39530 : * if u1.ndim == 2:
39531 : * if u1.shape[1] != v1.shape[1]:
39532 : * raise ValueError('Second dimension of u and v must be the same') # <<<<<<<<<<<<<<
39533 : * elif u1.shape[1] == 1:
39534 : * u1 = u1[:,0]
39535 : */
39536 3 : __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_Second_dimension_of_u_and_v_must); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2358, __pyx_L1_error)
39537 3 : __Pyx_GOTREF(__pyx_tuple__32);
39538 3 : __Pyx_GIVEREF(__pyx_tuple__32);
39539 :
39540 : /* "scipy/linalg/_decomp_update.pyx":2360
39541 : * raise ValueError('Second dimension of u and v must be the same')
39542 : * elif u1.shape[1] == 1:
39543 : * u1 = u1[:,0] # <<<<<<<<<<<<<<
39544 : * v1 = v1[:,0]
39545 : *
39546 : */
39547 3 : __pyx_tuple__33 = PyTuple_Pack(2, __pyx_slice__16, __pyx_int_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 2360, __pyx_L1_error)
39548 3 : __Pyx_GOTREF(__pyx_tuple__33);
39549 3 : __Pyx_GIVEREF(__pyx_tuple__33);
39550 :
39551 : /* "scipy/linalg/_decomp_update.pyx":2370
39552 : * # limit p to at most max(n, m)
39553 : * if p > n or p > m:
39554 : * raise ValueError('Update rank larger than np.dot(Q, R).') # <<<<<<<<<<<<<<
39555 : *
39556 : * u1 = validate_array(u1, chkfinite)
39557 : */
39558 3 : __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Update_rank_larger_than_np_dot_Q); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2370, __pyx_L1_error)
39559 3 : __Pyx_GOTREF(__pyx_tuple__34);
39560 3 : __Pyx_GIVEREF(__pyx_tuple__34);
39561 :
39562 : /* "scipy/linalg/_decomp_update.pyx":1195
39563 : * return 0
39564 : *
39565 : * def _form_qTu(object a, object b): # <<<<<<<<<<<<<<
39566 : * """ this function only exists to expose the cdef version below for testing
39567 : * purposes. Here we perform minimal input validation to ensure that the
39568 : */
39569 3 : __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_q, __pyx_n_s_u, __pyx_n_s_qTu, __pyx_n_s_typecode, __pyx_n_s_qTuvoid, __pyx_n_s_qTus); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1195, __pyx_L1_error)
39570 3 : __Pyx_GOTREF(__pyx_tuple__37);
39571 3 : __Pyx_GIVEREF(__pyx_tuple__37);
39572 3 : __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scipy_linalg__decomp_update_pyx, __pyx_n_s_form_qTu, 1195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 1195, __pyx_L1_error)
39573 :
39574 : /* "scipy/linalg/_decomp_update.pyx":1444
39575 : * return cnp.PyArray_DATA(arr)
39576 : *
39577 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
39578 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False,
39579 : * check_finite=True):
39580 : */
39581 3 : __pyx_tuple__39 = PyTuple_Pack(28, __pyx_n_s_Q, __pyx_n_s_R, __pyx_n_s_k, __pyx_n_s_p, __pyx_n_s_which, __pyx_n_s_overwrite_qr, __pyx_n_s_check_finite, __pyx_n_s_q1, __pyx_n_s_r1, __pyx_n_s_k1, __pyx_n_s_p1, __pyx_n_s_p_eco, __pyx_n_s_p_full, __pyx_n_s_typecode, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_info, __pyx_n_s_qptr, __pyx_n_s_rptr, __pyx_n_s_qs, __pyx_n_s_rs, __pyx_n_s_economic, __pyx_n_s_qisF, __pyx_n_s_chkfinite, __pyx_n_s_overwrite, __pyx_n_s_qnew, __pyx_n_s_norm, __pyx_n_s_o); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1444, __pyx_L1_error)
39582 3 : __Pyx_GOTREF(__pyx_tuple__39);
39583 3 : __Pyx_GIVEREF(__pyx_tuple__39);
39584 3 : __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scipy_linalg__decomp_update_pyx, __pyx_n_s_qr_delete, 1444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1444, __pyx_L1_error)
39585 :
39586 : /* "scipy/linalg/_decomp_update.pyx":1689
39587 : * raise ValueError("'which' must be either 'row' or 'col'")
39588 : *
39589 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
39590 : * def qr_insert(Q, R, u, k, which='row', rcond=None, overwrite_qru=False, check_finite=True):
39591 : * """
39592 : */
39593 3 : __pyx_tuple__41 = PyTuple_Pack(11, __pyx_n_s_Q, __pyx_n_s_R, __pyx_n_s_u, __pyx_n_s_k, __pyx_n_s_which, __pyx_n_s_rcond, __pyx_n_s_overwrite_qru, __pyx_n_s_check_finite, __pyx_n_s_chkfinite, __pyx_n_s_overwrite, __pyx_n_s_k1); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1689, __pyx_L1_error)
39594 3 : __Pyx_GOTREF(__pyx_tuple__41);
39595 3 : __Pyx_GIVEREF(__pyx_tuple__41);
39596 3 : __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scipy_linalg__decomp_update_pyx, __pyx_n_s_qr_insert, 1689, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 1689, __pyx_L1_error)
39597 3 : __pyx_tuple__43 = PyTuple_Pack(4, ((PyObject*)__pyx_n_u_row), Py_None, ((PyObject *)Py_False), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 1689, __pyx_L1_error)
39598 3 : __Pyx_GOTREF(__pyx_tuple__43);
39599 3 : __Pyx_GIVEREF(__pyx_tuple__43);
39600 :
39601 : /* "scipy/linalg/_decomp_update.pyx":2154
39602 : * return q1, rnew
39603 : *
39604 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
39605 : * def qr_update(Q, R, u, v, overwrite_qruv=False, check_finite=True):
39606 : * """
39607 : */
39608 3 : __pyx_tuple__44 = PyTuple_Pack(37, __pyx_n_s_Q, __pyx_n_s_R, __pyx_n_s_u, __pyx_n_s_v, __pyx_n_s_overwrite_qruv, __pyx_n_s_check_finite, __pyx_n_s_q1, __pyx_n_s_r1, __pyx_n_s_u1, __pyx_n_s_v1, __pyx_n_s_qTu, __pyx_n_s_s, __pyx_n_s_uv_flags, __pyx_n_s_typecode, __pyx_n_s_p, __pyx_n_s_m, __pyx_n_s_n, __pyx_n_s_info, __pyx_n_s_qptr, __pyx_n_s_rptr, __pyx_n_s_uptr, __pyx_n_s_vptr, __pyx_n_s_sptr, __pyx_n_s_qTuptr, __pyx_n_s_qs, __pyx_n_s_rs, __pyx_n_s_qTus, __pyx_n_s_us, __pyx_n_s_vs, __pyx_n_s_ss, __pyx_n_s_economic, __pyx_n_s_qisF, __pyx_n_s_chkfinite, __pyx_n_s_overwrite, __pyx_n_s_ndim, __pyx_n_s_length, __pyx_n_s_rnew); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 2154, __pyx_L1_error)
39609 3 : __Pyx_GOTREF(__pyx_tuple__44);
39610 3 : __Pyx_GIVEREF(__pyx_tuple__44);
39611 3 : __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 37, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scipy_linalg__decomp_update_pyx, __pyx_n_s_qr_update, 2154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 2154, __pyx_L1_error)
39612 3 : __pyx_tuple__46 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 2154, __pyx_L1_error)
39613 : __Pyx_GOTREF(__pyx_tuple__46);
39614 : __Pyx_GIVEREF(__pyx_tuple__46);
39615 : __Pyx_RefNannyFinishContext();
39616 : return 0;
39617 : __pyx_L1_error:;
39618 : __Pyx_RefNannyFinishContext();
39619 : return -1;
39620 : }
39621 : /* #### Code section: init_constants ### */
39622 :
39623 3 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
39624 3 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
39625 3 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
39626 3 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
39627 : return 0;
39628 : __pyx_L1_error:;
39629 : return -1;
39630 : }
39631 : /* #### Code section: init_globals ### */
39632 :
39633 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
39634 : return 0;
39635 : }
39636 : /* #### Code section: init_module ### */
39637 :
39638 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
39639 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
39640 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
39641 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
39642 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
39643 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
39644 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
39645 :
39646 : static int __Pyx_modinit_global_init_code(void) {
39647 : __Pyx_RefNannyDeclarations
39648 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
39649 : /*--- Global init code ---*/
39650 : __Pyx_RefNannyFinishContext();
39651 : return 0;
39652 : }
39653 :
39654 : static int __Pyx_modinit_variable_export_code(void) {
39655 : __Pyx_RefNannyDeclarations
39656 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
39657 : /*--- Variable export code ---*/
39658 : __Pyx_RefNannyFinishContext();
39659 : return 0;
39660 : }
39661 :
39662 : static int __Pyx_modinit_function_export_code(void) {
39663 : __Pyx_RefNannyDeclarations
39664 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
39665 : /*--- Function export code ---*/
39666 : __Pyx_RefNannyFinishContext();
39667 : return 0;
39668 : }
39669 :
39670 : static int __Pyx_modinit_type_init_code(void) {
39671 : __Pyx_RefNannyDeclarations
39672 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
39673 : /*--- Type init code ---*/
39674 : __Pyx_RefNannyFinishContext();
39675 : return 0;
39676 : }
39677 :
39678 3 : static int __Pyx_modinit_type_import_code(void) {
39679 : __Pyx_RefNannyDeclarations
39680 3 : PyObject *__pyx_t_1 = NULL;
39681 3 : int __pyx_lineno = 0;
39682 3 : const char *__pyx_filename = NULL;
39683 3 : int __pyx_clineno = 0;
39684 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
39685 : /*--- Type import code ---*/
39686 3 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
39687 3 : __Pyx_GOTREF(__pyx_t_1);
39688 3 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
39689 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
39690 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
39691 : #elif CYTHON_COMPILING_IN_LIMITED_API
39692 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
39693 : #else
39694 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
39695 : #endif
39696 3 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
39697 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39698 3 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 271, __pyx_L1_error)
39699 3 : __Pyx_GOTREF(__pyx_t_1);
39700 3 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 271, __pyx_L1_error)
39701 3 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 316, __pyx_L1_error)
39702 3 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 320, __pyx_L1_error)
39703 3 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 359, __pyx_L1_error)
39704 3 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
39705 3 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
39706 3 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
39707 3 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
39708 3 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
39709 3 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
39710 3 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
39711 3 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
39712 3 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
39713 3 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
39714 3 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 929, __pyx_L1_error)
39715 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39716 : __Pyx_RefNannyFinishContext();
39717 : return 0;
39718 0 : __pyx_L1_error:;
39719 0 : __Pyx_XDECREF(__pyx_t_1);
39720 0 : __Pyx_RefNannyFinishContext();
39721 0 : return -1;
39722 : }
39723 :
39724 : static int __Pyx_modinit_variable_import_code(void) {
39725 : __Pyx_RefNannyDeclarations
39726 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
39727 : /*--- Variable import code ---*/
39728 : __Pyx_RefNannyFinishContext();
39729 : return 0;
39730 : }
39731 :
39732 3 : static int __Pyx_modinit_function_import_code(void) {
39733 : __Pyx_RefNannyDeclarations
39734 3 : PyObject *__pyx_t_1 = NULL;
39735 3 : int __pyx_lineno = 0;
39736 3 : const char *__pyx_filename = NULL;
39737 3 : int __pyx_clineno = 0;
39738 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
39739 : /*--- Function import code ---*/
39740 3 : __pyx_t_1 = PyImport_ImportModule("scipy.linalg.cython_blas"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
39741 3 : __Pyx_GOTREF(__pyx_t_1);
39742 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "caxpy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_caxpy, "void (int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39743 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "ccopy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_ccopy, "void (int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39744 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cgemm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_cgemm, "void (char *, char *, int *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39745 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cgemv", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_cgemv, "void (char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39746 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cgeru", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_cgeru, "void (int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39747 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cscal", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_cscal, "void (int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39748 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cswap", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_cswap, "void (int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39749 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "ctrmm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_ctrmm, "void (char *, char *, char *, char *, int *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39750 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "daxpy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_daxpy, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39751 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dcopy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dcopy, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39752 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dgemm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dgemm, "void (char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39753 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dgemv", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dgemv, "void (char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39754 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dger", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dger, "void (int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39755 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dnrm2", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dnrm2, "__pyx_t_5scipy_6linalg_11cython_blas_d (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39756 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "drot", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_drot, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39757 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dscal", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dscal, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39758 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dswap", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dswap, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39759 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dtrmm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dtrmm, "void (char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *, __pyx_t_5scipy_6linalg_11cython_blas_d *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39760 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dznrm2", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_dznrm2, "__pyx_t_5scipy_6linalg_11cython_blas_d (int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39761 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "saxpy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_saxpy, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39762 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "scnrm2", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_scnrm2, "__pyx_t_5scipy_6linalg_11cython_blas_s (int *, __pyx_t_float_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39763 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "scopy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_scopy, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39764 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "sgemm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_sgemm, "void (char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39765 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "sgemv", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_sgemv, "void (char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39766 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "sger", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_sger, "void (int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39767 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "snrm2", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_snrm2, "__pyx_t_5scipy_6linalg_11cython_blas_s (int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39768 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "srot", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_srot, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39769 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "sscal", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_sscal, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39770 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "sswap", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_sswap, "void (int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39771 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "strmm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_strmm, "void (char *, char *, char *, char *, int *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *, __pyx_t_5scipy_6linalg_11cython_blas_s *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39772 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zaxpy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zaxpy, "void (int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39773 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zcopy", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zcopy, "void (int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39774 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zgemm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zgemm, "void (char *, char *, int *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39775 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zgemv", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zgemv, "void (char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39776 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zgeru", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zgeru, "void (int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39777 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zscal", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zscal, "void (int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39778 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zswap", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_zswap, "void (int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39779 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "ztrmm", (void (**)(void))&__pyx_f_5scipy_6linalg_11cython_blas_ztrmm, "void (char *, char *, char *, char *, int *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39780 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39781 3 : __pyx_t_1 = PyImport_ImportModule("scipy.linalg.cython_lapack"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
39782 3 : __Pyx_GOTREF(__pyx_t_1);
39783 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cgeqrf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_cgeqrf, "void (int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39784 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "clarf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_clarf, "void (char *, int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39785 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "clarfg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_clarfg, "void (int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39786 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "clartg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_clartg, "void (__pyx_t_float_complex *, __pyx_t_float_complex *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_float_complex *, __pyx_t_float_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39787 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "crot", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_crot, "void (int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_float_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39788 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "cunmqr", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_cunmqr, "void (char *, char *, int *, int *, int *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, __pyx_t_float_complex *, int *, __pyx_t_float_complex *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39789 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dgeqrf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dgeqrf, "void (int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39790 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dlarf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dlarf, "void (char *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39791 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dlarfg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dlarfg, "void (int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39792 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dlartg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dlartg, "void (__pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39793 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "dormqr", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_dormqr, "void (char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39794 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "sgeqrf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_sgeqrf, "void (int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39795 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "slarf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_slarf, "void (char *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39796 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "slarfg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_slarfg, "void (int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39797 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "slartg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_slartg, "void (__pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39798 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "sormqr", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_sormqr, "void (char *, char *, int *, int *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_s *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39799 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zgeqrf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zgeqrf, "void (int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39800 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zlarf", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zlarf, "void (char *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39801 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zlarfg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zlarfg, "void (int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39802 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zlartg", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zlartg, "void (__pyx_t_double_complex *, __pyx_t_double_complex *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_double_complex *, __pyx_t_double_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39803 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zrot", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zrot, "void (int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, __pyx_t_5scipy_6linalg_13cython_lapack_d *, __pyx_t_double_complex *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39804 3 : if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "zunmqr", (void (**)(void))&__pyx_f_5scipy_6linalg_13cython_lapack_zunmqr, "void (char *, char *, int *, int *, int *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, __pyx_t_double_complex *, int *, __pyx_t_double_complex *, int *, int *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39805 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39806 : __Pyx_RefNannyFinishContext();
39807 : return 0;
39808 0 : __pyx_L1_error:;
39809 0 : __Pyx_XDECREF(__pyx_t_1);
39810 0 : __Pyx_RefNannyFinishContext();
39811 0 : return -1;
39812 : }
39813 :
39814 :
39815 : #if PY_MAJOR_VERSION >= 3
39816 : #if CYTHON_PEP489_MULTI_PHASE_INIT
39817 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
39818 : static int __pyx_pymod_exec__decomp_update(PyObject* module); /*proto*/
39819 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
39820 : {Py_mod_create, (void*)__pyx_pymod_create},
39821 : {Py_mod_exec, (void*)__pyx_pymod_exec__decomp_update},
39822 : {0, NULL}
39823 : };
39824 : #endif
39825 :
39826 : #ifdef __cplusplus
39827 : namespace {
39828 : struct PyModuleDef __pyx_moduledef =
39829 : #else
39830 : static struct PyModuleDef __pyx_moduledef =
39831 : #endif
39832 : {
39833 : PyModuleDef_HEAD_INIT,
39834 : "_decomp_update",
39835 : __pyx_k_Routines_for_updating_QR_decomp, /* m_doc */
39836 : #if CYTHON_PEP489_MULTI_PHASE_INIT
39837 : 0, /* m_size */
39838 : #elif CYTHON_USE_MODULE_STATE
39839 : sizeof(__pyx_mstate), /* m_size */
39840 : #else
39841 : -1, /* m_size */
39842 : #endif
39843 : __pyx_methods /* m_methods */,
39844 : #if CYTHON_PEP489_MULTI_PHASE_INIT
39845 : __pyx_moduledef_slots, /* m_slots */
39846 : #else
39847 : NULL, /* m_reload */
39848 : #endif
39849 : #if CYTHON_USE_MODULE_STATE
39850 : __pyx_m_traverse, /* m_traverse */
39851 : __pyx_m_clear, /* m_clear */
39852 : NULL /* m_free */
39853 : #else
39854 : NULL, /* m_traverse */
39855 : NULL, /* m_clear */
39856 : NULL /* m_free */
39857 : #endif
39858 : };
39859 : #ifdef __cplusplus
39860 : } /* anonymous namespace */
39861 : #endif
39862 : #endif
39863 :
39864 : #ifndef CYTHON_NO_PYINIT_EXPORT
39865 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
39866 : #elif PY_MAJOR_VERSION < 3
39867 : #ifdef __cplusplus
39868 : #define __Pyx_PyMODINIT_FUNC extern "C" void
39869 : #else
39870 : #define __Pyx_PyMODINIT_FUNC void
39871 : #endif
39872 : #else
39873 : #ifdef __cplusplus
39874 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
39875 : #else
39876 : #define __Pyx_PyMODINIT_FUNC PyObject *
39877 : #endif
39878 : #endif
39879 :
39880 :
39881 : #if PY_MAJOR_VERSION < 3
39882 : __Pyx_PyMODINIT_FUNC init_decomp_update(void) CYTHON_SMALL_CODE; /*proto*/
39883 : __Pyx_PyMODINIT_FUNC init_decomp_update(void)
39884 : #else
39885 : __Pyx_PyMODINIT_FUNC PyInit__decomp_update(void) CYTHON_SMALL_CODE; /*proto*/
39886 3 : __Pyx_PyMODINIT_FUNC PyInit__decomp_update(void)
39887 : #if CYTHON_PEP489_MULTI_PHASE_INIT
39888 : {
39889 3 : return PyModuleDef_Init(&__pyx_moduledef);
39890 : }
39891 3 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
39892 : #if PY_VERSION_HEX >= 0x030700A1
39893 3 : static PY_INT64_T main_interpreter_id = -1;
39894 3 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
39895 3 : if (main_interpreter_id == -1) {
39896 3 : main_interpreter_id = current_id;
39897 6 : return (unlikely(current_id == -1)) ? -1 : 0;
39898 0 : } else if (unlikely(main_interpreter_id != current_id))
39899 : #else
39900 : static PyInterpreterState *main_interpreter = NULL;
39901 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
39902 : if (!main_interpreter) {
39903 : main_interpreter = current_interpreter;
39904 : } else if (unlikely(main_interpreter != current_interpreter))
39905 : #endif
39906 : {
39907 0 : PyErr_SetString(
39908 : PyExc_ImportError,
39909 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
39910 0 : return -1;
39911 : }
39912 : return 0;
39913 : }
39914 : #if CYTHON_COMPILING_IN_LIMITED_API
39915 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
39916 : #else
39917 12 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
39918 : #endif
39919 : {
39920 12 : PyObject *value = PyObject_GetAttrString(spec, from_name);
39921 12 : int result = 0;
39922 12 : if (likely(value)) {
39923 12 : if (allow_none || value != Py_None) {
39924 : #if CYTHON_COMPILING_IN_LIMITED_API
39925 : result = PyModule_AddObject(module, to_name, value);
39926 : #else
39927 9 : result = PyDict_SetItemString(moddict, to_name, value);
39928 : #endif
39929 : }
39930 12 : Py_DECREF(value);
39931 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
39932 0 : PyErr_Clear();
39933 : } else {
39934 : result = -1;
39935 : }
39936 12 : return result;
39937 : }
39938 3 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
39939 3 : PyObject *module = NULL, *moddict, *modname;
39940 3 : CYTHON_UNUSED_VAR(def);
39941 3 : if (__Pyx_check_single_interpreter())
39942 : return NULL;
39943 3 : if (__pyx_m)
39944 0 : return __Pyx_NewRef(__pyx_m);
39945 3 : modname = PyObject_GetAttrString(spec, "name");
39946 3 : if (unlikely(!modname)) goto bad;
39947 3 : module = PyModule_NewObject(modname);
39948 3 : Py_DECREF(modname);
39949 3 : if (unlikely(!module)) goto bad;
39950 : #if CYTHON_COMPILING_IN_LIMITED_API
39951 : moddict = module;
39952 : #else
39953 3 : moddict = PyModule_GetDict(module);
39954 3 : if (unlikely(!moddict)) goto bad;
39955 : #endif
39956 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
39957 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
39958 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
39959 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
39960 : return module;
39961 0 : bad:
39962 0 : Py_XDECREF(module);
39963 0 : return NULL;
39964 : }
39965 :
39966 :
39967 3 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__decomp_update(PyObject *__pyx_pyinit_module)
39968 : #endif
39969 : #endif
39970 : {
39971 3 : int stringtab_initialized = 0;
39972 : #if CYTHON_USE_MODULE_STATE
39973 : int pystate_addmodule_run = 0;
39974 : #endif
39975 3 : PyObject *__pyx_t_1 = NULL;
39976 3 : PyObject *__pyx_t_2 = NULL;
39977 3 : PyObject *__pyx_t_3 = NULL;
39978 3 : int __pyx_t_4;
39979 3 : int __pyx_lineno = 0;
39980 3 : const char *__pyx_filename = NULL;
39981 3 : int __pyx_clineno = 0;
39982 : __Pyx_RefNannyDeclarations
39983 : #if CYTHON_PEP489_MULTI_PHASE_INIT
39984 3 : if (__pyx_m) {
39985 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
39986 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_decomp_update' has already been imported. Re-initialisation is not supported.");
39987 0 : return -1;
39988 : }
39989 : #elif PY_MAJOR_VERSION >= 3
39990 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
39991 : #endif
39992 : /*--- Module creation code ---*/
39993 : #if CYTHON_PEP489_MULTI_PHASE_INIT
39994 3 : __pyx_m = __pyx_pyinit_module;
39995 3 : Py_INCREF(__pyx_m);
39996 : #else
39997 : #if PY_MAJOR_VERSION < 3
39998 : __pyx_m = Py_InitModule4("_decomp_update", __pyx_methods, __pyx_k_Routines_for_updating_QR_decomp, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
39999 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
40000 : #elif CYTHON_USE_MODULE_STATE
40001 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
40002 : {
40003 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
40004 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_decomp_update" pseudovariable */
40005 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
40006 : pystate_addmodule_run = 1;
40007 : }
40008 : #else
40009 : __pyx_m = PyModule_Create(&__pyx_moduledef);
40010 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
40011 : #endif
40012 : #endif
40013 3 : CYTHON_UNUSED_VAR(__pyx_t_1);
40014 3 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
40015 3 : Py_INCREF(__pyx_d);
40016 3 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
40017 3 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
40018 3 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40019 : #if CYTHON_REFNANNY
40020 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
40021 : if (!__Pyx_RefNanny) {
40022 : PyErr_Clear();
40023 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
40024 : if (!__Pyx_RefNanny)
40025 : Py_FatalError("failed to import 'refnanny' module");
40026 : }
40027 : #endif
40028 3 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__decomp_update(void)", 0);
40029 3 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40030 : #ifdef __Pxy_PyFrame_Initialize_Offsets
40031 : __Pxy_PyFrame_Initialize_Offsets();
40032 : #endif
40033 3 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
40034 3 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
40035 3 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
40036 : #ifdef __Pyx_CyFunction_USED
40037 3 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40038 : #endif
40039 : #ifdef __Pyx_FusedFunction_USED
40040 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40041 : #endif
40042 : #ifdef __Pyx_Coroutine_USED
40043 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40044 : #endif
40045 : #ifdef __Pyx_Generator_USED
40046 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40047 : #endif
40048 : #ifdef __Pyx_AsyncGen_USED
40049 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40050 : #endif
40051 : #ifdef __Pyx_StopAsyncIteration_USED
40052 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40053 : #endif
40054 : /*--- Library function declarations ---*/
40055 : /*--- Threads initialization code ---*/
40056 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
40057 : PyEval_InitThreads();
40058 : #endif
40059 : /*--- Initialize various global constants etc. ---*/
40060 3 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40061 3 : stringtab_initialized = 1;
40062 3 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40063 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
40064 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40065 : #endif
40066 3 : if (__pyx_module_is_main_scipy__linalg___decomp_update) {
40067 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40068 : }
40069 : #if PY_MAJOR_VERSION >= 3
40070 : {
40071 3 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
40072 3 : if (!PyDict_GetItemString(modules, "scipy.linalg._decomp_update")) {
40073 0 : if (unlikely((PyDict_SetItemString(modules, "scipy.linalg._decomp_update", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
40074 : }
40075 : }
40076 : #endif
40077 : /*--- Builtin init code ---*/
40078 3 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40079 : /*--- Constants init code ---*/
40080 3 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40081 : /*--- Global type/function init code ---*/
40082 3 : (void)__Pyx_modinit_global_init_code();
40083 3 : (void)__Pyx_modinit_variable_export_code();
40084 3 : (void)__Pyx_modinit_function_export_code();
40085 3 : (void)__Pyx_modinit_type_init_code();
40086 3 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
40087 3 : (void)__Pyx_modinit_variable_import_code();
40088 3 : if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
40089 : /*--- Execution code ---*/
40090 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
40091 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40092 : #endif
40093 :
40094 : /* "scipy/linalg/_decomp_update.pyx":35
40095 : * #
40096 : *
40097 : * __all__ = ['qr_delete', 'qr_insert', 'qr_update'] # <<<<<<<<<<<<<<
40098 : *
40099 : * cimport cython
40100 : */
40101 3 : __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
40102 3 : __Pyx_GOTREF(__pyx_t_2);
40103 3 : __Pyx_INCREF(__pyx_n_u_qr_delete);
40104 3 : __Pyx_GIVEREF(__pyx_n_u_qr_delete);
40105 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_qr_delete)) __PYX_ERR(0, 35, __pyx_L1_error);
40106 3 : __Pyx_INCREF(__pyx_n_u_qr_insert);
40107 3 : __Pyx_GIVEREF(__pyx_n_u_qr_insert);
40108 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_qr_insert)) __PYX_ERR(0, 35, __pyx_L1_error);
40109 3 : __Pyx_INCREF(__pyx_n_u_qr_update);
40110 3 : __Pyx_GIVEREF(__pyx_n_u_qr_update);
40111 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_qr_update)) __PYX_ERR(0, 35, __pyx_L1_error);
40112 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_2, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
40113 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40114 :
40115 : /* "scipy/linalg/_decomp_update.pyx":46
40116 : * cimport numpy as cnp
40117 : *
40118 : * from numpy.linalg import LinAlgError # <<<<<<<<<<<<<<
40119 : *
40120 : * # This is used in place of, e.g., cnp.NPY_ARRAY_C_CONTIGUOUS, to indicate that
40121 : */
40122 3 : __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
40123 3 : __Pyx_GOTREF(__pyx_t_2);
40124 3 : __Pyx_INCREF(__pyx_n_s_LinAlgError);
40125 3 : __Pyx_GIVEREF(__pyx_n_s_LinAlgError);
40126 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_LinAlgError)) __PYX_ERR(0, 46, __pyx_L1_error);
40127 3 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy_linalg, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error)
40128 3 : __Pyx_GOTREF(__pyx_t_3);
40129 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40130 3 : __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_LinAlgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
40131 3 : __Pyx_GOTREF(__pyx_t_2);
40132 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_LinAlgError, __pyx_t_2) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
40133 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40134 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40135 :
40136 : /* "scipy/linalg/_decomp_update.pyx":52
40137 : * DEF ARRAY_ANYORDER = 0
40138 : *
40139 : * cdef int MEMORY_ERROR = libc.limits.INT_MAX # <<<<<<<<<<<<<<
40140 : *
40141 : * # These are commented out in the numpy support we cimported above.
40142 : */
40143 3 : __pyx_v_5scipy_6linalg_14_decomp_update_MEMORY_ERROR = INT_MAX;
40144 :
40145 : /* "scipy/linalg/_decomp_update.pyx":64
40146 : * from . cimport cython_lapack as lapack_pointers
40147 : *
40148 : * import numpy as np # <<<<<<<<<<<<<<
40149 : *
40150 : * #------------------------------------------------------------------------------
40151 : */
40152 3 : __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
40153 3 : __Pyx_GOTREF(__pyx_t_3);
40154 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
40155 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40156 :
40157 : /* "scipy/linalg/_decomp_update.pyx":1195
40158 : * return 0
40159 : *
40160 : * def _form_qTu(object a, object b): # <<<<<<<<<<<<<<
40161 : * """ this function only exists to expose the cdef version below for testing
40162 : * purposes. Here we perform minimal input validation to ensure that the
40163 : */
40164 3 : __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_14_decomp_update_1_form_qTu, 0, __pyx_n_s_form_qTu, NULL, __pyx_n_s_scipy_linalg__decomp_update, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1195, __pyx_L1_error)
40165 3 : __Pyx_GOTREF(__pyx_t_3);
40166 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_form_qTu, __pyx_t_3) < 0) __PYX_ERR(0, 1195, __pyx_L1_error)
40167 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40168 :
40169 : /* "scipy/linalg/_decomp_update.pyx":1445
40170 : *
40171 : * @cython.embedsignature(True)
40172 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False, # <<<<<<<<<<<<<<
40173 : * check_finite=True):
40174 : * """
40175 : */
40176 3 : __pyx_t_3 = __Pyx_PyInt_From_int(((int)1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
40177 3 : __Pyx_GOTREF(__pyx_t_3);
40178 :
40179 : /* "scipy/linalg/_decomp_update.pyx":1444
40180 : * return cnp.PyArray_DATA(arr)
40181 : *
40182 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
40183 : * def qr_delete(Q, R, k, int p=1, which='row', overwrite_qr=False,
40184 : * check_finite=True):
40185 : */
40186 3 : __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
40187 3 : __Pyx_GOTREF(__pyx_t_2);
40188 3 : __Pyx_GIVEREF(__pyx_t_3);
40189 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1444, __pyx_L1_error);
40190 3 : __Pyx_INCREF(((PyObject*)__pyx_n_u_row));
40191 3 : __Pyx_GIVEREF(((PyObject*)__pyx_n_u_row));
40192 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject*)__pyx_n_u_row))) __PYX_ERR(0, 1444, __pyx_L1_error);
40193 3 : __Pyx_INCREF(((PyObject *)Py_False));
40194 3 : __Pyx_GIVEREF(((PyObject *)Py_False));
40195 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 1444, __pyx_L1_error);
40196 3 : __Pyx_INCREF(((PyObject *)Py_True));
40197 3 : __Pyx_GIVEREF(((PyObject *)Py_True));
40198 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)Py_True))) __PYX_ERR(0, 1444, __pyx_L1_error);
40199 3 : __pyx_t_3 = 0;
40200 3 : __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_14_decomp_update_3qr_delete, 0, __pyx_n_s_qr_delete, NULL, __pyx_n_s_scipy_linalg__decomp_update, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1444, __pyx_L1_error)
40201 3 : __Pyx_GOTREF(__pyx_t_3);
40202 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
40203 6 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40204 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_qr_delete, __pyx_t_3) < 0) __PYX_ERR(0, 1444, __pyx_L1_error)
40205 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40206 :
40207 : /* "scipy/linalg/_decomp_update.pyx":1689
40208 : * raise ValueError("'which' must be either 'row' or 'col'")
40209 : *
40210 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
40211 : * def qr_insert(Q, R, u, k, which='row', rcond=None, overwrite_qru=False, check_finite=True):
40212 : * """
40213 : */
40214 3 : __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_14_decomp_update_5qr_insert, 0, __pyx_n_s_qr_insert, NULL, __pyx_n_s_scipy_linalg__decomp_update, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1689, __pyx_L1_error)
40215 3 : __Pyx_GOTREF(__pyx_t_3);
40216 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__43);
40217 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_qr_insert, __pyx_t_3) < 0) __PYX_ERR(0, 1689, __pyx_L1_error)
40218 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40219 :
40220 : /* "scipy/linalg/_decomp_update.pyx":2154
40221 : * return q1, rnew
40222 : *
40223 : * @cython.embedsignature(True) # <<<<<<<<<<<<<<
40224 : * def qr_update(Q, R, u, v, overwrite_qruv=False, check_finite=True):
40225 : * """
40226 : */
40227 3 : __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6linalg_14_decomp_update_7qr_update, 0, __pyx_n_s_qr_update, NULL, __pyx_n_s_scipy_linalg__decomp_update, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2154, __pyx_L1_error)
40228 3 : __Pyx_GOTREF(__pyx_t_3);
40229 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__46);
40230 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_qr_update, __pyx_t_3) < 0) __PYX_ERR(0, 2154, __pyx_L1_error)
40231 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40232 :
40233 : /* "scipy/linalg/_decomp_update.pyx":2510
40234 : * return q1, r1
40235 : *
40236 : * cnp.import_array() # <<<<<<<<<<<<<<
40237 : */
40238 3 : __pyx_t_4 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2510, __pyx_L1_error)
40239 :
40240 : /* "scipy/linalg/_decomp_update.pyx":1
40241 : * """ # <<<<<<<<<<<<<<
40242 : * Routines for updating QR decompositions
40243 : *
40244 : */
40245 3 : __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
40246 3 : __Pyx_GOTREF(__pyx_t_3);
40247 3 : if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_qr_delete_line_1444, __pyx_kp_u_QR_downdate_on_row_or_column_de) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40248 3 : if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_qr_insert_line_1689, __pyx_kp_u_QR_update_on_row_or_column_inse) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40249 3 : if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_qr_update_line_2154, __pyx_kp_u_Rank_k_QR_update_If_A_Q_R_is_th) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40250 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40251 3 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40252 :
40253 : /*--- Wrapped vars code ---*/
40254 :
40255 3 : goto __pyx_L0;
40256 0 : __pyx_L1_error:;
40257 0 : __Pyx_XDECREF(__pyx_t_2);
40258 0 : __Pyx_XDECREF(__pyx_t_3);
40259 0 : if (__pyx_m) {
40260 0 : if (__pyx_d && stringtab_initialized) {
40261 0 : __Pyx_AddTraceback("init scipy.linalg._decomp_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
40262 : }
40263 : #if !CYTHON_USE_MODULE_STATE
40264 0 : Py_CLEAR(__pyx_m);
40265 : #else
40266 : Py_DECREF(__pyx_m);
40267 : if (pystate_addmodule_run) {
40268 : PyObject *tp, *value, *tb;
40269 : PyErr_Fetch(&tp, &value, &tb);
40270 : PyState_RemoveModule(&__pyx_moduledef);
40271 : PyErr_Restore(tp, value, tb);
40272 : }
40273 : #endif
40274 0 : } else if (!PyErr_Occurred()) {
40275 0 : PyErr_SetString(PyExc_ImportError, "init scipy.linalg._decomp_update");
40276 : }
40277 0 : __pyx_L0:;
40278 3 : __Pyx_RefNannyFinishContext();
40279 : #if CYTHON_PEP489_MULTI_PHASE_INIT
40280 3 : return (__pyx_m != NULL) ? 0 : -1;
40281 : #elif PY_MAJOR_VERSION >= 3
40282 : return __pyx_m;
40283 : #else
40284 : return;
40285 : #endif
40286 : }
40287 : /* #### Code section: cleanup_globals ### */
40288 : /* #### Code section: cleanup_module ### */
40289 : /* #### Code section: main_method ### */
40290 : /* #### Code section: utility_code_pragmas ### */
40291 : #ifdef _MSC_VER
40292 : #pragma warning( push )
40293 : /* Warning 4127: conditional expression is constant
40294 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
40295 : * compile-time, so this warning is not useful
40296 : */
40297 : #pragma warning( disable : 4127 )
40298 : #endif
40299 :
40300 :
40301 :
40302 : /* #### Code section: utility_code_def ### */
40303 :
40304 : /* --- Runtime support code --- */
40305 : /* Refnanny */
40306 : #if CYTHON_REFNANNY
40307 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
40308 : PyObject *m = NULL, *p = NULL;
40309 : void *r = NULL;
40310 : m = PyImport_ImportModule(modname);
40311 : if (!m) goto end;
40312 : p = PyObject_GetAttrString(m, "RefNannyAPI");
40313 : if (!p) goto end;
40314 : r = PyLong_AsVoidPtr(p);
40315 : end:
40316 : Py_XDECREF(p);
40317 : Py_XDECREF(m);
40318 : return (__Pyx_RefNannyAPIStruct *)r;
40319 : }
40320 : #endif
40321 :
40322 : /* PyErrExceptionMatches */
40323 : #if CYTHON_FAST_THREAD_STATE
40324 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
40325 0 : Py_ssize_t i, n;
40326 0 : n = PyTuple_GET_SIZE(tuple);
40327 : #if PY_MAJOR_VERSION >= 3
40328 0 : for (i=0; i<n; i++) {
40329 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
40330 : }
40331 : #endif
40332 0 : for (i=0; i<n; i++) {
40333 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
40334 : }
40335 : return 0;
40336 : }
40337 0 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
40338 0 : int result;
40339 0 : PyObject *exc_type;
40340 : #if PY_VERSION_HEX >= 0x030C00A6
40341 0 : PyObject *current_exception = tstate->current_exception;
40342 0 : if (unlikely(!current_exception)) return 0;
40343 0 : exc_type = (PyObject*) Py_TYPE(current_exception);
40344 0 : if (exc_type == err) return 1;
40345 : #else
40346 : exc_type = tstate->curexc_type;
40347 : if (exc_type == err) return 1;
40348 : if (unlikely(!exc_type)) return 0;
40349 : #endif
40350 : #if CYTHON_AVOID_BORROWED_REFS
40351 : Py_INCREF(exc_type);
40352 : #endif
40353 0 : if (unlikely(PyTuple_Check(err))) {
40354 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
40355 : } else {
40356 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
40357 : }
40358 : #if CYTHON_AVOID_BORROWED_REFS
40359 : Py_DECREF(exc_type);
40360 : #endif
40361 : return result;
40362 : }
40363 : #endif
40364 :
40365 : /* PyErrFetchRestore */
40366 : #if CYTHON_FAST_THREAD_STATE
40367 2660 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
40368 : #if PY_VERSION_HEX >= 0x030C00A6
40369 2660 : PyObject *tmp_value;
40370 2660 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
40371 2660 : if (value) {
40372 : #if CYTHON_COMPILING_IN_CPYTHON
40373 2660 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
40374 : #endif
40375 0 : PyException_SetTraceback(value, tb);
40376 : }
40377 2660 : tmp_value = tstate->current_exception;
40378 2660 : tstate->current_exception = value;
40379 2660 : Py_XDECREF(tmp_value);
40380 2660 : Py_XDECREF(type);
40381 2660 : Py_XDECREF(tb);
40382 : #else
40383 : PyObject *tmp_type, *tmp_value, *tmp_tb;
40384 : tmp_type = tstate->curexc_type;
40385 : tmp_value = tstate->curexc_value;
40386 : tmp_tb = tstate->curexc_traceback;
40387 : tstate->curexc_type = type;
40388 : tstate->curexc_value = value;
40389 : tstate->curexc_traceback = tb;
40390 : Py_XDECREF(tmp_type);
40391 : Py_XDECREF(tmp_value);
40392 : Py_XDECREF(tmp_tb);
40393 : #endif
40394 2660 : }
40395 2660 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
40396 : #if PY_VERSION_HEX >= 0x030C00A6
40397 2660 : PyObject* exc_value;
40398 2660 : exc_value = tstate->current_exception;
40399 2660 : tstate->current_exception = 0;
40400 2660 : *value = exc_value;
40401 2660 : *type = NULL;
40402 2660 : *tb = NULL;
40403 2660 : if (exc_value) {
40404 2660 : *type = (PyObject*) Py_TYPE(exc_value);
40405 2660 : Py_INCREF(*type);
40406 : #if CYTHON_COMPILING_IN_CPYTHON
40407 2660 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
40408 2660 : Py_XINCREF(*tb);
40409 : #else
40410 : *tb = PyException_GetTraceback(exc_value);
40411 : #endif
40412 : }
40413 : #else
40414 : *type = tstate->curexc_type;
40415 : *value = tstate->curexc_value;
40416 : *tb = tstate->curexc_traceback;
40417 : tstate->curexc_type = 0;
40418 : tstate->curexc_value = 0;
40419 : tstate->curexc_traceback = 0;
40420 : #endif
40421 2660 : }
40422 : #endif
40423 :
40424 : /* PyObjectGetAttrStr */
40425 : #if CYTHON_USE_TYPE_SLOTS
40426 46404 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
40427 46404 : PyTypeObject* tp = Py_TYPE(obj);
40428 46404 : if (likely(tp->tp_getattro))
40429 46404 : return tp->tp_getattro(obj, attr_name);
40430 : #if PY_MAJOR_VERSION < 3
40431 : if (likely(tp->tp_getattr))
40432 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
40433 : #endif
40434 0 : return PyObject_GetAttr(obj, attr_name);
40435 : }
40436 : #endif
40437 :
40438 : /* PyObjectGetAttrStrNoError */
40439 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
40440 0 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
40441 0 : __Pyx_PyThreadState_declare
40442 0 : __Pyx_PyThreadState_assign
40443 0 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
40444 0 : __Pyx_PyErr_Clear();
40445 0 : }
40446 : #endif
40447 18 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
40448 18 : PyObject *result;
40449 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
40450 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
40451 : return result;
40452 : #else
40453 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
40454 18 : PyTypeObject* tp = Py_TYPE(obj);
40455 18 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
40456 3 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
40457 : }
40458 : #endif
40459 15 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
40460 15 : if (unlikely(!result)) {
40461 0 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
40462 : }
40463 : return result;
40464 : #endif
40465 : }
40466 :
40467 : /* GetBuiltinName */
40468 12 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
40469 12 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
40470 12 : if (unlikely(!result) && !PyErr_Occurred()) {
40471 0 : PyErr_Format(PyExc_NameError,
40472 : #if PY_MAJOR_VERSION >= 3
40473 : "name '%U' is not defined", name);
40474 : #else
40475 : "name '%.200s' is not defined", PyString_AS_STRING(name));
40476 : #endif
40477 : }
40478 12 : return result;
40479 : }
40480 :
40481 : /* GetTopmostException */
40482 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
40483 : static _PyErr_StackItem *
40484 3 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
40485 : {
40486 3 : _PyErr_StackItem *exc_info = tstate->exc_info;
40487 15 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
40488 15 : exc_info->previous_item != NULL)
40489 : {
40490 : exc_info = exc_info->previous_item;
40491 : }
40492 3 : return exc_info;
40493 : }
40494 : #endif
40495 :
40496 : /* SaveResetException */
40497 : #if CYTHON_FAST_THREAD_STATE
40498 3 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
40499 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
40500 3 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
40501 3 : PyObject *exc_value = exc_info->exc_value;
40502 3 : if (exc_value == NULL || exc_value == Py_None) {
40503 3 : *value = NULL;
40504 3 : *type = NULL;
40505 3 : *tb = NULL;
40506 : } else {
40507 0 : *value = exc_value;
40508 0 : Py_INCREF(*value);
40509 0 : *type = (PyObject*) Py_TYPE(exc_value);
40510 0 : Py_INCREF(*type);
40511 0 : *tb = PyException_GetTraceback(exc_value);
40512 : }
40513 : #elif CYTHON_USE_EXC_INFO_STACK
40514 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
40515 : *type = exc_info->exc_type;
40516 : *value = exc_info->exc_value;
40517 : *tb = exc_info->exc_traceback;
40518 : Py_XINCREF(*type);
40519 : Py_XINCREF(*value);
40520 : Py_XINCREF(*tb);
40521 : #else
40522 : *type = tstate->exc_type;
40523 : *value = tstate->exc_value;
40524 : *tb = tstate->exc_traceback;
40525 : Py_XINCREF(*type);
40526 : Py_XINCREF(*value);
40527 : Py_XINCREF(*tb);
40528 : #endif
40529 3 : }
40530 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
40531 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
40532 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
40533 0 : PyObject *tmp_value = exc_info->exc_value;
40534 0 : exc_info->exc_value = value;
40535 0 : Py_XDECREF(tmp_value);
40536 0 : Py_XDECREF(type);
40537 0 : Py_XDECREF(tb);
40538 : #else
40539 : PyObject *tmp_type, *tmp_value, *tmp_tb;
40540 : #if CYTHON_USE_EXC_INFO_STACK
40541 : _PyErr_StackItem *exc_info = tstate->exc_info;
40542 : tmp_type = exc_info->exc_type;
40543 : tmp_value = exc_info->exc_value;
40544 : tmp_tb = exc_info->exc_traceback;
40545 : exc_info->exc_type = type;
40546 : exc_info->exc_value = value;
40547 : exc_info->exc_traceback = tb;
40548 : #else
40549 : tmp_type = tstate->exc_type;
40550 : tmp_value = tstate->exc_value;
40551 : tmp_tb = tstate->exc_traceback;
40552 : tstate->exc_type = type;
40553 : tstate->exc_value = value;
40554 : tstate->exc_traceback = tb;
40555 : #endif
40556 : Py_XDECREF(tmp_type);
40557 : Py_XDECREF(tmp_value);
40558 : Py_XDECREF(tmp_tb);
40559 : #endif
40560 0 : }
40561 : #endif
40562 :
40563 : /* GetException */
40564 : #if CYTHON_FAST_THREAD_STATE
40565 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
40566 : #else
40567 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
40568 : #endif
40569 : {
40570 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
40571 : #if CYTHON_FAST_THREAD_STATE
40572 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
40573 : #if PY_VERSION_HEX >= 0x030C00A6
40574 0 : local_value = tstate->current_exception;
40575 0 : tstate->current_exception = 0;
40576 0 : if (likely(local_value)) {
40577 0 : local_type = (PyObject*) Py_TYPE(local_value);
40578 0 : Py_INCREF(local_type);
40579 0 : local_tb = PyException_GetTraceback(local_value);
40580 : }
40581 : #else
40582 : local_type = tstate->curexc_type;
40583 : local_value = tstate->curexc_value;
40584 : local_tb = tstate->curexc_traceback;
40585 : tstate->curexc_type = 0;
40586 : tstate->curexc_value = 0;
40587 : tstate->curexc_traceback = 0;
40588 : #endif
40589 : #else
40590 : PyErr_Fetch(&local_type, &local_value, &local_tb);
40591 : #endif
40592 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
40593 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
40594 0 : if (unlikely(tstate->current_exception))
40595 : #elif CYTHON_FAST_THREAD_STATE
40596 : if (unlikely(tstate->curexc_type))
40597 : #else
40598 : if (unlikely(PyErr_Occurred()))
40599 : #endif
40600 0 : goto bad;
40601 : #if PY_MAJOR_VERSION >= 3
40602 0 : if (local_tb) {
40603 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
40604 0 : goto bad;
40605 : }
40606 : #endif
40607 0 : Py_XINCREF(local_tb);
40608 0 : Py_XINCREF(local_type);
40609 0 : Py_XINCREF(local_value);
40610 0 : *type = local_type;
40611 0 : *value = local_value;
40612 0 : *tb = local_tb;
40613 : #if CYTHON_FAST_THREAD_STATE
40614 : #if CYTHON_USE_EXC_INFO_STACK
40615 : {
40616 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
40617 : #if PY_VERSION_HEX >= 0x030B00a4
40618 0 : tmp_value = exc_info->exc_value;
40619 0 : exc_info->exc_value = local_value;
40620 0 : tmp_type = NULL;
40621 0 : tmp_tb = NULL;
40622 0 : Py_XDECREF(local_type);
40623 0 : Py_XDECREF(local_tb);
40624 : #else
40625 : tmp_type = exc_info->exc_type;
40626 : tmp_value = exc_info->exc_value;
40627 : tmp_tb = exc_info->exc_traceback;
40628 : exc_info->exc_type = local_type;
40629 : exc_info->exc_value = local_value;
40630 : exc_info->exc_traceback = local_tb;
40631 : #endif
40632 : }
40633 : #else
40634 : tmp_type = tstate->exc_type;
40635 : tmp_value = tstate->exc_value;
40636 : tmp_tb = tstate->exc_traceback;
40637 : tstate->exc_type = local_type;
40638 : tstate->exc_value = local_value;
40639 : tstate->exc_traceback = local_tb;
40640 : #endif
40641 0 : Py_XDECREF(tmp_type);
40642 0 : Py_XDECREF(tmp_value);
40643 0 : Py_XDECREF(tmp_tb);
40644 : #else
40645 : PyErr_SetExcInfo(local_type, local_value, local_tb);
40646 : #endif
40647 0 : return 0;
40648 0 : bad:
40649 0 : *type = 0;
40650 0 : *value = 0;
40651 0 : *tb = 0;
40652 0 : Py_XDECREF(local_type);
40653 0 : Py_XDECREF(local_value);
40654 0 : Py_XDECREF(local_tb);
40655 0 : return -1;
40656 : }
40657 :
40658 : /* PyObjectCall */
40659 : #if CYTHON_COMPILING_IN_CPYTHON
40660 1274 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
40661 1274 : PyObject *result;
40662 1274 : ternaryfunc call = Py_TYPE(func)->tp_call;
40663 1274 : if (unlikely(!call))
40664 0 : return PyObject_Call(func, arg, kw);
40665 : #if PY_MAJOR_VERSION < 3
40666 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
40667 : return NULL;
40668 : #else
40669 1274 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
40670 : return NULL;
40671 : #endif
40672 1274 : result = (*call)(func, arg, kw);
40673 1274 : Py_LeaveRecursiveCall();
40674 1274 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
40675 0 : PyErr_SetString(
40676 : PyExc_SystemError,
40677 : "NULL result without error in PyObject_Call");
40678 : }
40679 : return result;
40680 : }
40681 : #endif
40682 :
40683 : /* RaiseException */
40684 : #if PY_MAJOR_VERSION < 3
40685 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
40686 : __Pyx_PyThreadState_declare
40687 : CYTHON_UNUSED_VAR(cause);
40688 : Py_XINCREF(type);
40689 : if (!value || value == Py_None)
40690 : value = NULL;
40691 : else
40692 : Py_INCREF(value);
40693 : if (!tb || tb == Py_None)
40694 : tb = NULL;
40695 : else {
40696 : Py_INCREF(tb);
40697 : if (!PyTraceBack_Check(tb)) {
40698 : PyErr_SetString(PyExc_TypeError,
40699 : "raise: arg 3 must be a traceback or None");
40700 : goto raise_error;
40701 : }
40702 : }
40703 : if (PyType_Check(type)) {
40704 : #if CYTHON_COMPILING_IN_PYPY
40705 : if (!value) {
40706 : Py_INCREF(Py_None);
40707 : value = Py_None;
40708 : }
40709 : #endif
40710 : PyErr_NormalizeException(&type, &value, &tb);
40711 : } else {
40712 : if (value) {
40713 : PyErr_SetString(PyExc_TypeError,
40714 : "instance exception may not have a separate value");
40715 : goto raise_error;
40716 : }
40717 : value = type;
40718 : type = (PyObject*) Py_TYPE(type);
40719 : Py_INCREF(type);
40720 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
40721 : PyErr_SetString(PyExc_TypeError,
40722 : "raise: exception class must be a subclass of BaseException");
40723 : goto raise_error;
40724 : }
40725 : }
40726 : __Pyx_PyThreadState_assign
40727 : __Pyx_ErrRestore(type, value, tb);
40728 : return;
40729 : raise_error:
40730 : Py_XDECREF(value);
40731 : Py_XDECREF(type);
40732 : Py_XDECREF(tb);
40733 : return;
40734 : }
40735 : #else
40736 1208 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
40737 1208 : PyObject* owned_instance = NULL;
40738 1208 : if (tb == Py_None) {
40739 : tb = 0;
40740 1208 : } else if (tb && !PyTraceBack_Check(tb)) {
40741 0 : PyErr_SetString(PyExc_TypeError,
40742 : "raise: arg 3 must be a traceback or None");
40743 0 : goto bad;
40744 : }
40745 1208 : if (value == Py_None)
40746 0 : value = 0;
40747 1208 : if (PyExceptionInstance_Check(type)) {
40748 1208 : if (value) {
40749 0 : PyErr_SetString(PyExc_TypeError,
40750 : "instance exception may not have a separate value");
40751 0 : goto bad;
40752 : }
40753 : value = type;
40754 : type = (PyObject*) Py_TYPE(value);
40755 0 : } else if (PyExceptionClass_Check(type)) {
40756 0 : PyObject *instance_class = NULL;
40757 0 : if (value && PyExceptionInstance_Check(value)) {
40758 0 : instance_class = (PyObject*) Py_TYPE(value);
40759 0 : if (instance_class != type) {
40760 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
40761 0 : if (!is_subclass) {
40762 : instance_class = NULL;
40763 0 : } else if (unlikely(is_subclass == -1)) {
40764 0 : goto bad;
40765 : } else {
40766 : type = instance_class;
40767 : }
40768 : }
40769 : }
40770 : if (!instance_class) {
40771 0 : PyObject *args;
40772 0 : if (!value)
40773 0 : args = PyTuple_New(0);
40774 0 : else if (PyTuple_Check(value)) {
40775 0 : Py_INCREF(value);
40776 0 : args = value;
40777 : } else
40778 0 : args = PyTuple_Pack(1, value);
40779 0 : if (!args)
40780 0 : goto bad;
40781 0 : owned_instance = PyObject_Call(type, args, NULL);
40782 0 : Py_DECREF(args);
40783 0 : if (!owned_instance)
40784 0 : goto bad;
40785 0 : value = owned_instance;
40786 0 : if (!PyExceptionInstance_Check(value)) {
40787 0 : PyErr_Format(PyExc_TypeError,
40788 : "calling %R should have returned an instance of "
40789 : "BaseException, not %R",
40790 : type, Py_TYPE(value));
40791 0 : goto bad;
40792 : }
40793 : }
40794 : } else {
40795 0 : PyErr_SetString(PyExc_TypeError,
40796 : "raise: exception class must be a subclass of BaseException");
40797 0 : goto bad;
40798 : }
40799 1208 : if (cause) {
40800 0 : PyObject *fixed_cause;
40801 0 : if (cause == Py_None) {
40802 : fixed_cause = NULL;
40803 0 : } else if (PyExceptionClass_Check(cause)) {
40804 0 : fixed_cause = PyObject_CallObject(cause, NULL);
40805 0 : if (fixed_cause == NULL)
40806 0 : goto bad;
40807 0 : } else if (PyExceptionInstance_Check(cause)) {
40808 0 : fixed_cause = cause;
40809 0 : Py_INCREF(fixed_cause);
40810 : } else {
40811 0 : PyErr_SetString(PyExc_TypeError,
40812 : "exception causes must derive from "
40813 : "BaseException");
40814 0 : goto bad;
40815 : }
40816 0 : PyException_SetCause(value, fixed_cause);
40817 : }
40818 1208 : PyErr_SetObject(type, value);
40819 1208 : if (tb) {
40820 : #if PY_VERSION_HEX >= 0x030C00A6
40821 0 : PyException_SetTraceback(value, tb);
40822 : #elif CYTHON_FAST_THREAD_STATE
40823 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
40824 : PyObject* tmp_tb = tstate->curexc_traceback;
40825 : if (tb != tmp_tb) {
40826 : Py_INCREF(tb);
40827 : tstate->curexc_traceback = tb;
40828 : Py_XDECREF(tmp_tb);
40829 : }
40830 : #else
40831 : PyObject *tmp_type, *tmp_value, *tmp_tb;
40832 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
40833 : Py_INCREF(tb);
40834 : PyErr_Restore(tmp_type, tmp_value, tb);
40835 : Py_XDECREF(tmp_tb);
40836 : #endif
40837 : }
40838 1208 : bad:
40839 1208 : Py_XDECREF(owned_instance);
40840 1208 : return;
40841 : }
40842 : #endif
40843 :
40844 : /* WriteUnraisableException */
40845 0 : static void __Pyx_WriteUnraisable(const char *name, int clineno,
40846 : int lineno, const char *filename,
40847 : int full_traceback, int nogil) {
40848 0 : PyObject *old_exc, *old_val, *old_tb;
40849 0 : PyObject *ctx;
40850 0 : __Pyx_PyThreadState_declare
40851 : #ifdef WITH_THREAD
40852 0 : PyGILState_STATE state;
40853 0 : if (nogil)
40854 0 : state = PyGILState_Ensure();
40855 : else state = (PyGILState_STATE)0;
40856 : #endif
40857 0 : CYTHON_UNUSED_VAR(clineno);
40858 0 : CYTHON_UNUSED_VAR(lineno);
40859 0 : CYTHON_UNUSED_VAR(filename);
40860 0 : CYTHON_MAYBE_UNUSED_VAR(nogil);
40861 0 : __Pyx_PyThreadState_assign
40862 0 : __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
40863 0 : if (full_traceback) {
40864 0 : Py_XINCREF(old_exc);
40865 0 : Py_XINCREF(old_val);
40866 0 : Py_XINCREF(old_tb);
40867 0 : __Pyx_ErrRestore(old_exc, old_val, old_tb);
40868 0 : PyErr_PrintEx(0);
40869 : }
40870 : #if PY_MAJOR_VERSION < 3
40871 : ctx = PyString_FromString(name);
40872 : #else
40873 0 : ctx = PyUnicode_FromString(name);
40874 : #endif
40875 0 : __Pyx_ErrRestore(old_exc, old_val, old_tb);
40876 0 : if (!ctx) {
40877 0 : PyErr_WriteUnraisable(Py_None);
40878 : } else {
40879 0 : PyErr_WriteUnraisable(ctx);
40880 0 : Py_DECREF(ctx);
40881 : }
40882 : #ifdef WITH_THREAD
40883 0 : if (nogil)
40884 0 : PyGILState_Release(state);
40885 : #endif
40886 0 : }
40887 :
40888 : /* TupleAndListFromArray */
40889 : #if CYTHON_COMPILING_IN_CPYTHON
40890 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
40891 : PyObject *v;
40892 : Py_ssize_t i;
40893 : for (i = 0; i < length; i++) {
40894 : v = dest[i] = src[i];
40895 : Py_INCREF(v);
40896 : }
40897 : }
40898 : static CYTHON_INLINE PyObject *
40899 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
40900 : {
40901 : PyObject *res;
40902 : if (n <= 0) {
40903 : Py_INCREF(__pyx_empty_tuple);
40904 : return __pyx_empty_tuple;
40905 : }
40906 : res = PyTuple_New(n);
40907 : if (unlikely(res == NULL)) return NULL;
40908 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
40909 : return res;
40910 : }
40911 : static CYTHON_INLINE PyObject *
40912 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
40913 : {
40914 : PyObject *res;
40915 : if (n <= 0) {
40916 : return PyList_New(0);
40917 : }
40918 : res = PyList_New(n);
40919 : if (unlikely(res == NULL)) return NULL;
40920 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
40921 : return res;
40922 : }
40923 : #endif
40924 :
40925 : /* BytesEquals */
40926 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
40927 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
40928 : return PyObject_RichCompareBool(s1, s2, equals);
40929 : #else
40930 : if (s1 == s2) {
40931 : return (equals == Py_EQ);
40932 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
40933 : const char *ps1, *ps2;
40934 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
40935 : if (length != PyBytes_GET_SIZE(s2))
40936 : return (equals == Py_NE);
40937 : ps1 = PyBytes_AS_STRING(s1);
40938 : ps2 = PyBytes_AS_STRING(s2);
40939 : if (ps1[0] != ps2[0]) {
40940 : return (equals == Py_NE);
40941 : } else if (length == 1) {
40942 : return (equals == Py_EQ);
40943 : } else {
40944 : int result;
40945 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
40946 : Py_hash_t hash1, hash2;
40947 : hash1 = ((PyBytesObject*)s1)->ob_shash;
40948 : hash2 = ((PyBytesObject*)s2)->ob_shash;
40949 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
40950 : return (equals == Py_NE);
40951 : }
40952 : #endif
40953 : result = memcmp(ps1, ps2, (size_t)length);
40954 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
40955 : }
40956 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
40957 : return (equals == Py_NE);
40958 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
40959 : return (equals == Py_NE);
40960 : } else {
40961 : int result;
40962 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
40963 : if (!py_result)
40964 : return -1;
40965 : result = __Pyx_PyObject_IsTrue(py_result);
40966 : Py_DECREF(py_result);
40967 : return result;
40968 : }
40969 : #endif
40970 : }
40971 :
40972 : /* UnicodeEquals */
40973 96382 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
40974 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
40975 : return PyObject_RichCompareBool(s1, s2, equals);
40976 : #else
40977 : #if PY_MAJOR_VERSION < 3
40978 : PyObject* owned_ref = NULL;
40979 : #endif
40980 96382 : int s1_is_unicode, s2_is_unicode;
40981 96382 : if (s1 == s2) {
40982 22802 : goto return_eq;
40983 : }
40984 73580 : s1_is_unicode = PyUnicode_CheckExact(s1);
40985 73580 : s2_is_unicode = PyUnicode_CheckExact(s2);
40986 : #if PY_MAJOR_VERSION < 3
40987 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
40988 : owned_ref = PyUnicode_FromObject(s2);
40989 : if (unlikely(!owned_ref))
40990 : return -1;
40991 : s2 = owned_ref;
40992 : s2_is_unicode = 1;
40993 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
40994 : owned_ref = PyUnicode_FromObject(s1);
40995 : if (unlikely(!owned_ref))
40996 : return -1;
40997 : s1 = owned_ref;
40998 : s1_is_unicode = 1;
40999 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
41000 : return __Pyx_PyBytes_Equals(s1, s2, equals);
41001 : }
41002 : #endif
41003 73580 : if (s1_is_unicode & s2_is_unicode) {
41004 73580 : Py_ssize_t length;
41005 73580 : int kind;
41006 73580 : void *data1, *data2;
41007 73580 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
41008 : return -1;
41009 73580 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
41010 73580 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
41011 37004 : goto return_ne;
41012 : }
41013 : #if CYTHON_USE_UNICODE_INTERNALS
41014 : {
41015 36576 : Py_hash_t hash1, hash2;
41016 : #if CYTHON_PEP393_ENABLED
41017 36576 : hash1 = ((PyASCIIObject*)s1)->hash;
41018 36576 : hash2 = ((PyASCIIObject*)s2)->hash;
41019 : #else
41020 : hash1 = ((PyUnicodeObject*)s1)->hash;
41021 : hash2 = ((PyUnicodeObject*)s2)->hash;
41022 : #endif
41023 36576 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
41024 36576 : goto return_ne;
41025 : }
41026 : }
41027 : #endif
41028 0 : kind = __Pyx_PyUnicode_KIND(s1);
41029 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
41030 0 : goto return_ne;
41031 : }
41032 0 : data1 = __Pyx_PyUnicode_DATA(s1);
41033 0 : data2 = __Pyx_PyUnicode_DATA(s2);
41034 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
41035 0 : goto return_ne;
41036 0 : } else if (length == 1) {
41037 0 : goto return_eq;
41038 : } else {
41039 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
41040 : #if PY_MAJOR_VERSION < 3
41041 : Py_XDECREF(owned_ref);
41042 : #endif
41043 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
41044 : }
41045 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
41046 0 : goto return_ne;
41047 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
41048 0 : goto return_ne;
41049 : } else {
41050 0 : int result;
41051 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
41052 : #if PY_MAJOR_VERSION < 3
41053 : Py_XDECREF(owned_ref);
41054 : #endif
41055 0 : if (!py_result)
41056 : return -1;
41057 0 : result = __Pyx_PyObject_IsTrue(py_result);
41058 0 : Py_DECREF(py_result);
41059 0 : return result;
41060 : }
41061 22802 : return_eq:
41062 : #if PY_MAJOR_VERSION < 3
41063 : Py_XDECREF(owned_ref);
41064 : #endif
41065 22802 : return (equals == Py_EQ);
41066 73580 : return_ne:
41067 : #if PY_MAJOR_VERSION < 3
41068 : Py_XDECREF(owned_ref);
41069 : #endif
41070 73580 : return (equals == Py_NE);
41071 : #endif
41072 : }
41073 :
41074 : /* fastcall */
41075 : #if CYTHON_METH_FASTCALL
41076 74420 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
41077 : {
41078 74420 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
41079 179160 : for (i = 0; i < n; i++)
41080 : {
41081 159118 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
41082 : }
41083 73840 : for (i = 0; i < n; i++)
41084 : {
41085 53798 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
41086 53798 : if (unlikely(eq != 0)) {
41087 0 : if (unlikely(eq < 0)) return NULL;
41088 0 : return kwvalues[i];
41089 : }
41090 : }
41091 : return NULL;
41092 : }
41093 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
41094 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
41095 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
41096 : PyObject *dict;
41097 : dict = PyDict_New();
41098 : if (unlikely(!dict))
41099 : return NULL;
41100 : for (i=0; i<nkwargs; i++) {
41101 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
41102 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
41103 : goto bad;
41104 : }
41105 : return dict;
41106 : bad:
41107 : Py_DECREF(dict);
41108 : return NULL;
41109 : }
41110 : #endif
41111 : #endif
41112 :
41113 : /* RaiseArgTupleInvalid */
41114 0 : static void __Pyx_RaiseArgtupleInvalid(
41115 : const char* func_name,
41116 : int exact,
41117 : Py_ssize_t num_min,
41118 : Py_ssize_t num_max,
41119 : Py_ssize_t num_found)
41120 : {
41121 0 : Py_ssize_t num_expected;
41122 0 : const char *more_or_less;
41123 0 : if (num_found < num_min) {
41124 : num_expected = num_min;
41125 : more_or_less = "at least";
41126 : } else {
41127 0 : num_expected = num_max;
41128 0 : more_or_less = "at most";
41129 : }
41130 0 : if (exact) {
41131 0 : more_or_less = "exactly";
41132 : }
41133 0 : PyErr_Format(PyExc_TypeError,
41134 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
41135 : func_name, more_or_less, num_expected,
41136 : (num_expected == 1) ? "" : "s", num_found);
41137 0 : }
41138 :
41139 : /* RaiseDoubleKeywords */
41140 0 : static void __Pyx_RaiseDoubleKeywordsError(
41141 : const char* func_name,
41142 : PyObject* kw_name)
41143 : {
41144 0 : PyErr_Format(PyExc_TypeError,
41145 : #if PY_MAJOR_VERSION >= 3
41146 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
41147 : #else
41148 : "%s() got multiple values for keyword argument '%s'", func_name,
41149 : PyString_AsString(kw_name));
41150 : #endif
41151 : }
41152 :
41153 : /* ParseKeywords */
41154 0 : static int __Pyx_ParseOptionalKeywords(
41155 : PyObject *kwds,
41156 : PyObject *const *kwvalues,
41157 : PyObject **argnames[],
41158 : PyObject *kwds2,
41159 : PyObject *values[],
41160 : Py_ssize_t num_pos_args,
41161 : const char* function_name)
41162 : {
41163 0 : PyObject *key = 0, *value = 0;
41164 0 : Py_ssize_t pos = 0;
41165 0 : PyObject*** name;
41166 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
41167 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
41168 0 : while (1) {
41169 0 : Py_XDECREF(key); key = NULL;
41170 0 : Py_XDECREF(value); value = NULL;
41171 0 : if (kwds_is_tuple) {
41172 0 : Py_ssize_t size;
41173 : #if CYTHON_ASSUME_SAFE_MACROS
41174 0 : size = PyTuple_GET_SIZE(kwds);
41175 : #else
41176 : size = PyTuple_Size(kwds);
41177 : if (size < 0) goto bad;
41178 : #endif
41179 0 : if (pos >= size) break;
41180 : #if CYTHON_AVOID_BORROWED_REFS
41181 : key = __Pyx_PySequence_ITEM(kwds, pos);
41182 : if (!key) goto bad;
41183 : #elif CYTHON_ASSUME_SAFE_MACROS
41184 0 : key = PyTuple_GET_ITEM(kwds, pos);
41185 : #else
41186 : key = PyTuple_GetItem(kwds, pos);
41187 : if (!key) goto bad;
41188 : #endif
41189 0 : value = kwvalues[pos];
41190 0 : pos++;
41191 : }
41192 : else
41193 : {
41194 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
41195 : #if CYTHON_AVOID_BORROWED_REFS
41196 : Py_INCREF(key);
41197 : #endif
41198 : }
41199 0 : name = first_kw_arg;
41200 0 : while (*name && (**name != key)) name++;
41201 0 : if (*name) {
41202 0 : values[name-argnames] = value;
41203 : #if CYTHON_AVOID_BORROWED_REFS
41204 : Py_INCREF(value);
41205 : Py_DECREF(key);
41206 : #endif
41207 0 : key = NULL;
41208 0 : value = NULL;
41209 0 : continue;
41210 : }
41211 : #if !CYTHON_AVOID_BORROWED_REFS
41212 0 : Py_INCREF(key);
41213 : #endif
41214 0 : Py_INCREF(value);
41215 0 : name = first_kw_arg;
41216 : #if PY_MAJOR_VERSION < 3
41217 : if (likely(PyString_Check(key))) {
41218 : while (*name) {
41219 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
41220 : && _PyString_Eq(**name, key)) {
41221 : values[name-argnames] = value;
41222 : #if CYTHON_AVOID_BORROWED_REFS
41223 : value = NULL;
41224 : #endif
41225 : break;
41226 : }
41227 : name++;
41228 : }
41229 : if (*name) continue;
41230 : else {
41231 : PyObject*** argname = argnames;
41232 : while (argname != first_kw_arg) {
41233 : if ((**argname == key) || (
41234 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
41235 : && _PyString_Eq(**argname, key))) {
41236 : goto arg_passed_twice;
41237 : }
41238 : argname++;
41239 : }
41240 : }
41241 : } else
41242 : #endif
41243 0 : if (likely(PyUnicode_Check(key))) {
41244 0 : while (*name) {
41245 0 : int cmp = (
41246 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
41247 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
41248 : #endif
41249 0 : PyUnicode_Compare(**name, key)
41250 : );
41251 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
41252 0 : if (cmp == 0) {
41253 0 : values[name-argnames] = value;
41254 : #if CYTHON_AVOID_BORROWED_REFS
41255 : value = NULL;
41256 : #endif
41257 0 : break;
41258 : }
41259 0 : name++;
41260 : }
41261 0 : if (*name) continue;
41262 : else {
41263 : PyObject*** argname = argnames;
41264 0 : while (argname != first_kw_arg) {
41265 0 : int cmp = (**argname == key) ? 0 :
41266 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
41267 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
41268 : #endif
41269 0 : PyUnicode_Compare(**argname, key);
41270 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
41271 0 : if (cmp == 0) goto arg_passed_twice;
41272 0 : argname++;
41273 : }
41274 : }
41275 : } else
41276 0 : goto invalid_keyword_type;
41277 0 : if (kwds2) {
41278 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
41279 : } else {
41280 0 : goto invalid_keyword;
41281 : }
41282 : }
41283 0 : Py_XDECREF(key);
41284 0 : Py_XDECREF(value);
41285 0 : return 0;
41286 0 : arg_passed_twice:
41287 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
41288 0 : goto bad;
41289 0 : invalid_keyword_type:
41290 0 : PyErr_Format(PyExc_TypeError,
41291 : "%.200s() keywords must be strings", function_name);
41292 0 : goto bad;
41293 0 : invalid_keyword:
41294 : #if PY_MAJOR_VERSION < 3
41295 : PyErr_Format(PyExc_TypeError,
41296 : "%.200s() got an unexpected keyword argument '%.200s'",
41297 : function_name, PyString_AsString(key));
41298 : #else
41299 0 : PyErr_Format(PyExc_TypeError,
41300 : "%s() got an unexpected keyword argument '%U'",
41301 : function_name, key);
41302 : #endif
41303 0 : bad:
41304 0 : Py_XDECREF(key);
41305 0 : Py_XDECREF(value);
41306 0 : return -1;
41307 : }
41308 :
41309 : /* ExtTypeTest */
41310 145476 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
41311 145476 : __Pyx_TypeName obj_type_name;
41312 145476 : __Pyx_TypeName type_name;
41313 145476 : if (unlikely(!type)) {
41314 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
41315 0 : return 0;
41316 : }
41317 145476 : if (likely(__Pyx_TypeCheck(obj, type)))
41318 : return 1;
41319 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
41320 0 : type_name = __Pyx_PyType_GetName(type);
41321 0 : PyErr_Format(PyExc_TypeError,
41322 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
41323 : obj_type_name, type_name);
41324 0 : __Pyx_DECREF_TypeName(obj_type_name);
41325 0 : __Pyx_DECREF_TypeName(type_name);
41326 0 : return 0;
41327 : }
41328 :
41329 : /* PyDictVersioning */
41330 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
41331 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
41332 : PyObject *dict = Py_TYPE(obj)->tp_dict;
41333 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
41334 : }
41335 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
41336 : PyObject **dictptr = NULL;
41337 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
41338 : if (offset) {
41339 : #if CYTHON_COMPILING_IN_CPYTHON
41340 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
41341 : #else
41342 : dictptr = _PyObject_GetDictPtr(obj);
41343 : #endif
41344 : }
41345 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
41346 : }
41347 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
41348 : PyObject *dict = Py_TYPE(obj)->tp_dict;
41349 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
41350 : return 0;
41351 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
41352 : }
41353 : #endif
41354 :
41355 : /* GetModuleGlobalName */
41356 : #if CYTHON_USE_DICT_VERSIONS
41357 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
41358 : #else
41359 22420 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
41360 : #endif
41361 : {
41362 22420 : PyObject *result;
41363 : #if !CYTHON_AVOID_BORROWED_REFS
41364 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
41365 22420 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
41366 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
41367 22420 : if (likely(result)) {
41368 44840 : return __Pyx_NewRef(result);
41369 0 : } else if (unlikely(PyErr_Occurred())) {
41370 : return NULL;
41371 : }
41372 : #elif CYTHON_COMPILING_IN_LIMITED_API
41373 : if (unlikely(!__pyx_m)) {
41374 : return NULL;
41375 : }
41376 : result = PyObject_GetAttr(__pyx_m, name);
41377 : if (likely(result)) {
41378 : return result;
41379 : }
41380 : #else
41381 : result = PyDict_GetItem(__pyx_d, name);
41382 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
41383 : if (likely(result)) {
41384 : return __Pyx_NewRef(result);
41385 : }
41386 : #endif
41387 : #else
41388 : result = PyObject_GetItem(__pyx_d, name);
41389 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
41390 : if (likely(result)) {
41391 : return __Pyx_NewRef(result);
41392 : }
41393 : PyErr_Clear();
41394 : #endif
41395 0 : return __Pyx_GetBuiltinName(name);
41396 : }
41397 :
41398 : /* PyFunctionFastCall */
41399 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
41400 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
41401 : PyObject *globals) {
41402 : PyFrameObject *f;
41403 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
41404 : PyObject **fastlocals;
41405 : Py_ssize_t i;
41406 : PyObject *result;
41407 : assert(globals != NULL);
41408 : /* XXX Perhaps we should create a specialized
41409 : PyFrame_New() that doesn't take locals, but does
41410 : take builtins without sanity checking them.
41411 : */
41412 : assert(tstate != NULL);
41413 : f = PyFrame_New(tstate, co, globals, NULL);
41414 : if (f == NULL) {
41415 : return NULL;
41416 : }
41417 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
41418 : for (i = 0; i < na; i++) {
41419 : Py_INCREF(*args);
41420 : fastlocals[i] = *args++;
41421 : }
41422 : result = PyEval_EvalFrameEx(f,0);
41423 : ++tstate->recursion_depth;
41424 : Py_DECREF(f);
41425 : --tstate->recursion_depth;
41426 : return result;
41427 : }
41428 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
41429 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
41430 : PyObject *globals = PyFunction_GET_GLOBALS(func);
41431 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
41432 : PyObject *closure;
41433 : #if PY_MAJOR_VERSION >= 3
41434 : PyObject *kwdefs;
41435 : #endif
41436 : PyObject *kwtuple, **k;
41437 : PyObject **d;
41438 : Py_ssize_t nd;
41439 : Py_ssize_t nk;
41440 : PyObject *result;
41441 : assert(kwargs == NULL || PyDict_Check(kwargs));
41442 : nk = kwargs ? PyDict_Size(kwargs) : 0;
41443 : #if PY_MAJOR_VERSION < 3
41444 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
41445 : return NULL;
41446 : }
41447 : #else
41448 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
41449 : return NULL;
41450 : }
41451 : #endif
41452 : if (
41453 : #if PY_MAJOR_VERSION >= 3
41454 : co->co_kwonlyargcount == 0 &&
41455 : #endif
41456 : likely(kwargs == NULL || nk == 0) &&
41457 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
41458 : if (argdefs == NULL && co->co_argcount == nargs) {
41459 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
41460 : goto done;
41461 : }
41462 : else if (nargs == 0 && argdefs != NULL
41463 : && co->co_argcount == Py_SIZE(argdefs)) {
41464 : /* function called with no arguments, but all parameters have
41465 : a default value: use default values as arguments .*/
41466 : args = &PyTuple_GET_ITEM(argdefs, 0);
41467 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
41468 : goto done;
41469 : }
41470 : }
41471 : if (kwargs != NULL) {
41472 : Py_ssize_t pos, i;
41473 : kwtuple = PyTuple_New(2 * nk);
41474 : if (kwtuple == NULL) {
41475 : result = NULL;
41476 : goto done;
41477 : }
41478 : k = &PyTuple_GET_ITEM(kwtuple, 0);
41479 : pos = i = 0;
41480 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
41481 : Py_INCREF(k[i]);
41482 : Py_INCREF(k[i+1]);
41483 : i += 2;
41484 : }
41485 : nk = i / 2;
41486 : }
41487 : else {
41488 : kwtuple = NULL;
41489 : k = NULL;
41490 : }
41491 : closure = PyFunction_GET_CLOSURE(func);
41492 : #if PY_MAJOR_VERSION >= 3
41493 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
41494 : #endif
41495 : if (argdefs != NULL) {
41496 : d = &PyTuple_GET_ITEM(argdefs, 0);
41497 : nd = Py_SIZE(argdefs);
41498 : }
41499 : else {
41500 : d = NULL;
41501 : nd = 0;
41502 : }
41503 : #if PY_MAJOR_VERSION >= 3
41504 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
41505 : args, (int)nargs,
41506 : k, (int)nk,
41507 : d, (int)nd, kwdefs, closure);
41508 : #else
41509 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
41510 : args, (int)nargs,
41511 : k, (int)nk,
41512 : d, (int)nd, closure);
41513 : #endif
41514 : Py_XDECREF(kwtuple);
41515 : done:
41516 : Py_LeaveRecursiveCall();
41517 : return result;
41518 : }
41519 : #endif
41520 :
41521 : /* PyObjectCallMethO */
41522 : #if CYTHON_COMPILING_IN_CPYTHON
41523 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
41524 0 : PyObject *self, *result;
41525 0 : PyCFunction cfunc;
41526 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
41527 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
41528 : #if PY_MAJOR_VERSION < 3
41529 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
41530 : return NULL;
41531 : #else
41532 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
41533 : return NULL;
41534 : #endif
41535 0 : result = cfunc(self, arg);
41536 0 : Py_LeaveRecursiveCall();
41537 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
41538 0 : PyErr_SetString(
41539 : PyExc_SystemError,
41540 : "NULL result without error in PyObject_Call");
41541 : }
41542 : return result;
41543 : }
41544 : #endif
41545 :
41546 : /* PyObjectFastCall */
41547 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
41548 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
41549 : PyObject *argstuple;
41550 : PyObject *result = 0;
41551 : size_t i;
41552 : argstuple = PyTuple_New((Py_ssize_t)nargs);
41553 : if (unlikely(!argstuple)) return NULL;
41554 : for (i = 0; i < nargs; i++) {
41555 : Py_INCREF(args[i]);
41556 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
41557 : }
41558 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
41559 : bad:
41560 : Py_DECREF(argstuple);
41561 : return result;
41562 : }
41563 : #endif
41564 45354 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
41565 45354 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
41566 : #if CYTHON_COMPILING_IN_CPYTHON
41567 45354 : if (nargs == 0 && kwargs == NULL) {
41568 22256 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
41569 0 : return __Pyx_PyObject_CallMethO(func, NULL);
41570 : }
41571 23098 : else if (nargs == 1 && kwargs == NULL) {
41572 22846 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
41573 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
41574 : }
41575 : #endif
41576 : #if PY_VERSION_HEX < 0x030800B1
41577 : #if CYTHON_FAST_PYCCALL
41578 : if (PyCFunction_Check(func)) {
41579 : if (kwargs) {
41580 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
41581 : } else {
41582 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
41583 : }
41584 : }
41585 : #if PY_VERSION_HEX >= 0x030700A1
41586 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
41587 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
41588 : }
41589 : #endif
41590 : #endif
41591 : #if CYTHON_FAST_PYCALL
41592 : if (PyFunction_Check(func)) {
41593 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
41594 : }
41595 : #endif
41596 : #endif
41597 45354 : if (kwargs == NULL) {
41598 : #if CYTHON_VECTORCALL
41599 : #if PY_VERSION_HEX < 0x03090000
41600 : vectorcallfunc f = _PyVectorcall_Function(func);
41601 : #else
41602 45354 : vectorcallfunc f = PyVectorcall_Function(func);
41603 : #endif
41604 45354 : if (f) {
41605 45180 : return f(func, args, (size_t)nargs, NULL);
41606 : }
41607 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
41608 : if (__Pyx_CyFunction_CheckExact(func)) {
41609 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
41610 : if (f) return f(func, args, (size_t)nargs, NULL);
41611 : }
41612 : #endif
41613 : }
41614 174 : if (nargs == 0) {
41615 120 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
41616 : }
41617 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
41618 54 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
41619 : #else
41620 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
41621 : #endif
41622 : }
41623 :
41624 : /* GetAttr */
41625 78 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
41626 : #if CYTHON_USE_TYPE_SLOTS
41627 : #if PY_MAJOR_VERSION >= 3
41628 78 : if (likely(PyUnicode_Check(n)))
41629 : #else
41630 : if (likely(PyString_Check(n)))
41631 : #endif
41632 78 : return __Pyx_PyObject_GetAttrStr(o, n);
41633 : #endif
41634 0 : return PyObject_GetAttr(o, n);
41635 : }
41636 :
41637 : /* JoinPyUnicode */
41638 28 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
41639 : Py_UCS4 max_char) {
41640 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41641 28 : PyObject *result_uval;
41642 28 : int result_ukind, kind_shift;
41643 28 : Py_ssize_t i, char_pos;
41644 28 : void *result_udata;
41645 28 : CYTHON_MAYBE_UNUSED_VAR(max_char);
41646 : #if CYTHON_PEP393_ENABLED
41647 28 : result_uval = PyUnicode_New(result_ulength, max_char);
41648 28 : if (unlikely(!result_uval)) return NULL;
41649 28 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
41650 28 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
41651 28 : result_udata = PyUnicode_DATA(result_uval);
41652 : #else
41653 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
41654 : if (unlikely(!result_uval)) return NULL;
41655 : result_ukind = sizeof(Py_UNICODE);
41656 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
41657 : result_udata = PyUnicode_AS_UNICODE(result_uval);
41658 : #endif
41659 28 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
41660 28 : char_pos = 0;
41661 168 : for (i=0; i < value_count; i++) {
41662 140 : int ukind;
41663 140 : Py_ssize_t ulength;
41664 140 : void *udata;
41665 140 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
41666 140 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
41667 : goto bad;
41668 140 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
41669 140 : if (unlikely(!ulength))
41670 0 : continue;
41671 140 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
41672 0 : goto overflow;
41673 140 : ukind = __Pyx_PyUnicode_KIND(uval);
41674 140 : udata = __Pyx_PyUnicode_DATA(uval);
41675 140 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
41676 140 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
41677 : } else {
41678 : #if PY_VERSION_HEX >= 0x030d0000
41679 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
41680 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
41681 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
41682 : #else
41683 : Py_ssize_t j;
41684 : for (j=0; j < ulength; j++) {
41685 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
41686 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
41687 : }
41688 : #endif
41689 : }
41690 140 : char_pos += ulength;
41691 : }
41692 : return result_uval;
41693 0 : overflow:
41694 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
41695 0 : bad:
41696 0 : Py_DECREF(result_uval);
41697 : return NULL;
41698 : #else
41699 : CYTHON_UNUSED_VAR(max_char);
41700 : CYTHON_UNUSED_VAR(result_ulength);
41701 : CYTHON_UNUSED_VAR(value_count);
41702 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
41703 : #endif
41704 : }
41705 :
41706 : /* PyObjectCallOneArg */
41707 50 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
41708 50 : PyObject *args[2] = {NULL, arg};
41709 50 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
41710 : }
41711 :
41712 : /* RaiseTooManyValuesToUnpack */
41713 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
41714 0 : PyErr_Format(PyExc_ValueError,
41715 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
41716 0 : }
41717 :
41718 : /* RaiseNeedMoreValuesToUnpack */
41719 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
41720 0 : PyErr_Format(PyExc_ValueError,
41721 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
41722 : index, (index == 1) ? "" : "s");
41723 0 : }
41724 :
41725 : /* RaiseNoneIterError */
41726 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
41727 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
41728 : }
41729 :
41730 : /* GetItemInt */
41731 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
41732 0 : PyObject *r;
41733 0 : if (unlikely(!j)) return NULL;
41734 0 : r = PyObject_GetItem(o, j);
41735 0 : Py_DECREF(j);
41736 : return r;
41737 : }
41738 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
41739 : CYTHON_NCP_UNUSED int wraparound,
41740 : CYTHON_NCP_UNUSED int boundscheck) {
41741 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41742 : Py_ssize_t wrapped_i = i;
41743 : if (wraparound & unlikely(i < 0)) {
41744 : wrapped_i += PyList_GET_SIZE(o);
41745 : }
41746 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
41747 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
41748 : Py_INCREF(r);
41749 : return r;
41750 : }
41751 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
41752 : #else
41753 : return PySequence_GetItem(o, i);
41754 : #endif
41755 : }
41756 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
41757 : CYTHON_NCP_UNUSED int wraparound,
41758 : CYTHON_NCP_UNUSED int boundscheck) {
41759 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41760 : Py_ssize_t wrapped_i = i;
41761 : if (wraparound & unlikely(i < 0)) {
41762 : wrapped_i += PyTuple_GET_SIZE(o);
41763 : }
41764 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
41765 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
41766 : Py_INCREF(r);
41767 : return r;
41768 : }
41769 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
41770 : #else
41771 : return PySequence_GetItem(o, i);
41772 : #endif
41773 : }
41774 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
41775 : CYTHON_NCP_UNUSED int wraparound,
41776 : CYTHON_NCP_UNUSED int boundscheck) {
41777 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
41778 0 : if (is_list || PyList_CheckExact(o)) {
41779 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
41780 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
41781 0 : PyObject *r = PyList_GET_ITEM(o, n);
41782 0 : Py_INCREF(r);
41783 0 : return r;
41784 : }
41785 : }
41786 0 : else if (PyTuple_CheckExact(o)) {
41787 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
41788 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
41789 0 : PyObject *r = PyTuple_GET_ITEM(o, n);
41790 0 : Py_INCREF(r);
41791 0 : return r;
41792 : }
41793 : } else {
41794 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
41795 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
41796 0 : if (mm && mm->mp_subscript) {
41797 0 : PyObject *r, *key = PyInt_FromSsize_t(i);
41798 0 : if (unlikely(!key)) return NULL;
41799 0 : r = mm->mp_subscript(o, key);
41800 0 : Py_DECREF(key);
41801 0 : return r;
41802 : }
41803 0 : if (likely(sm && sm->sq_item)) {
41804 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
41805 0 : Py_ssize_t l = sm->sq_length(o);
41806 0 : if (likely(l >= 0)) {
41807 0 : i += l;
41808 : } else {
41809 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
41810 : return NULL;
41811 0 : PyErr_Clear();
41812 : }
41813 : }
41814 0 : return sm->sq_item(o, i);
41815 : }
41816 : }
41817 : #else
41818 : if (is_list || !PyMapping_Check(o)) {
41819 : return PySequence_GetItem(o, i);
41820 : }
41821 : #endif
41822 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
41823 : }
41824 :
41825 : /* ObjectGetItem */
41826 : #if CYTHON_USE_TYPE_SLOTS
41827 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
41828 0 : PyObject *runerr = NULL;
41829 0 : Py_ssize_t key_value;
41830 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
41831 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
41832 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
41833 : }
41834 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
41835 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
41836 0 : PyErr_Clear();
41837 0 : PyErr_Format(PyExc_IndexError,
41838 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
41839 : __Pyx_DECREF_TypeName(index_type_name);
41840 : }
41841 : return NULL;
41842 : }
41843 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
41844 0 : __Pyx_TypeName obj_type_name;
41845 0 : if (likely(PyType_Check(obj))) {
41846 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
41847 0 : if (!meth) {
41848 0 : PyErr_Clear();
41849 : } else {
41850 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
41851 0 : Py_DECREF(meth);
41852 0 : return result;
41853 : }
41854 : }
41855 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
41856 0 : PyErr_Format(PyExc_TypeError,
41857 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
41858 0 : __Pyx_DECREF_TypeName(obj_type_name);
41859 0 : return NULL;
41860 : }
41861 40024 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
41862 40024 : PyTypeObject *tp = Py_TYPE(obj);
41863 40024 : PyMappingMethods *mm = tp->tp_as_mapping;
41864 40024 : PySequenceMethods *sm = tp->tp_as_sequence;
41865 40024 : if (likely(mm && mm->mp_subscript)) {
41866 40024 : return mm->mp_subscript(obj, key);
41867 : }
41868 0 : if (likely(sm && sm->sq_item)) {
41869 0 : return __Pyx_PyObject_GetIndex(obj, key);
41870 : }
41871 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
41872 : }
41873 : #endif
41874 :
41875 : /* TypeImport */
41876 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
41877 : #define __PYX_HAVE_RT_ImportType_3_0_11
41878 48 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
41879 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
41880 : {
41881 48 : PyObject *result = 0;
41882 48 : char warning[200];
41883 48 : Py_ssize_t basicsize;
41884 48 : Py_ssize_t itemsize;
41885 : #if CYTHON_COMPILING_IN_LIMITED_API
41886 : PyObject *py_basicsize;
41887 : PyObject *py_itemsize;
41888 : #endif
41889 48 : result = PyObject_GetAttrString(module, class_name);
41890 48 : if (!result)
41891 0 : goto bad;
41892 48 : if (!PyType_Check(result)) {
41893 0 : PyErr_Format(PyExc_TypeError,
41894 : "%.200s.%.200s is not a type object",
41895 : module_name, class_name);
41896 0 : goto bad;
41897 : }
41898 : #if !CYTHON_COMPILING_IN_LIMITED_API
41899 48 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
41900 48 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
41901 : #else
41902 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
41903 : if (!py_basicsize)
41904 : goto bad;
41905 : basicsize = PyLong_AsSsize_t(py_basicsize);
41906 : Py_DECREF(py_basicsize);
41907 : py_basicsize = 0;
41908 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
41909 : goto bad;
41910 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
41911 : if (!py_itemsize)
41912 : goto bad;
41913 : itemsize = PyLong_AsSsize_t(py_itemsize);
41914 : Py_DECREF(py_itemsize);
41915 : py_itemsize = 0;
41916 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
41917 : goto bad;
41918 : #endif
41919 48 : if (itemsize) {
41920 3 : if (size % alignment) {
41921 0 : alignment = size % alignment;
41922 : }
41923 3 : if (itemsize < (Py_ssize_t)alignment)
41924 : itemsize = (Py_ssize_t)alignment;
41925 : }
41926 48 : if ((size_t)(basicsize + itemsize) < size) {
41927 0 : PyErr_Format(PyExc_ValueError,
41928 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
41929 : "Expected %zd from C header, got %zd from PyObject",
41930 : module_name, class_name, size, basicsize+itemsize);
41931 0 : goto bad;
41932 : }
41933 48 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
41934 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
41935 0 : PyErr_Format(PyExc_ValueError,
41936 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
41937 : "Expected %zd from C header, got %zd-%zd from PyObject",
41938 : module_name, class_name, size, basicsize, basicsize+itemsize);
41939 0 : goto bad;
41940 : }
41941 48 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
41942 0 : PyOS_snprintf(warning, sizeof(warning),
41943 : "%s.%s size changed, may indicate binary incompatibility. "
41944 : "Expected %zd from C header, got %zd from PyObject",
41945 : module_name, class_name, size, basicsize);
41946 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
41947 : }
41948 : return (PyTypeObject *)result;
41949 0 : bad:
41950 0 : Py_XDECREF(result);
41951 0 : return NULL;
41952 : }
41953 : #endif
41954 :
41955 : /* Import */
41956 3 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
41957 3 : PyObject *module = 0;
41958 3 : PyObject *empty_dict = 0;
41959 3 : PyObject *empty_list = 0;
41960 : #if PY_MAJOR_VERSION < 3
41961 : PyObject *py_import;
41962 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
41963 : if (unlikely(!py_import))
41964 : goto bad;
41965 : if (!from_list) {
41966 : empty_list = PyList_New(0);
41967 : if (unlikely(!empty_list))
41968 : goto bad;
41969 : from_list = empty_list;
41970 : }
41971 : #endif
41972 3 : empty_dict = PyDict_New();
41973 3 : if (unlikely(!empty_dict))
41974 0 : goto bad;
41975 : {
41976 : #if PY_MAJOR_VERSION >= 3
41977 3 : if (level == -1) {
41978 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
41979 0 : module = PyImport_ImportModuleLevelObject(
41980 0 : name, __pyx_d, empty_dict, from_list, 1);
41981 0 : if (unlikely(!module)) {
41982 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
41983 0 : goto bad;
41984 0 : PyErr_Clear();
41985 : }
41986 : }
41987 0 : level = 0;
41988 : }
41989 : #endif
41990 0 : if (!module) {
41991 : #if PY_MAJOR_VERSION < 3
41992 : PyObject *py_level = PyInt_FromLong(level);
41993 : if (unlikely(!py_level))
41994 : goto bad;
41995 : module = PyObject_CallFunctionObjArgs(py_import,
41996 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
41997 : Py_DECREF(py_level);
41998 : #else
41999 3 : module = PyImport_ImportModuleLevelObject(
42000 3 : name, __pyx_d, empty_dict, from_list, level);
42001 : #endif
42002 : }
42003 : }
42004 3 : bad:
42005 3 : Py_XDECREF(empty_dict);
42006 3 : Py_XDECREF(empty_list);
42007 : #if PY_MAJOR_VERSION < 3
42008 : Py_XDECREF(py_import);
42009 : #endif
42010 3 : return module;
42011 : }
42012 :
42013 : /* ImportFrom */
42014 3 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
42015 3 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
42016 3 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
42017 0 : const char* module_name_str = 0;
42018 0 : PyObject* module_name = 0;
42019 0 : PyObject* module_dot = 0;
42020 0 : PyObject* full_name = 0;
42021 0 : PyErr_Clear();
42022 0 : module_name_str = PyModule_GetName(module);
42023 0 : if (unlikely(!module_name_str)) { goto modbad; }
42024 0 : module_name = PyUnicode_FromString(module_name_str);
42025 0 : if (unlikely(!module_name)) { goto modbad; }
42026 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__35);
42027 0 : if (unlikely(!module_dot)) { goto modbad; }
42028 0 : full_name = PyUnicode_Concat(module_dot, name);
42029 0 : if (unlikely(!full_name)) { goto modbad; }
42030 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
42031 : {
42032 : PyObject *modules = PyImport_GetModuleDict();
42033 : if (unlikely(!modules))
42034 : goto modbad;
42035 : value = PyObject_GetItem(modules, full_name);
42036 : }
42037 : #else
42038 0 : value = PyImport_GetModule(full_name);
42039 : #endif
42040 0 : modbad:
42041 0 : Py_XDECREF(full_name);
42042 0 : Py_XDECREF(module_dot);
42043 0 : Py_XDECREF(module_name);
42044 : }
42045 3 : if (unlikely(!value)) {
42046 0 : PyErr_Format(PyExc_ImportError,
42047 : #if PY_MAJOR_VERSION < 3
42048 : "cannot import name %.230s", PyString_AS_STRING(name));
42049 : #else
42050 : "cannot import name %S", name);
42051 : #endif
42052 : }
42053 3 : return value;
42054 : }
42055 :
42056 : /* ImportDottedModule */
42057 : #if PY_MAJOR_VERSION >= 3
42058 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
42059 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
42060 0 : if (unlikely(PyErr_Occurred())) {
42061 0 : PyErr_Clear();
42062 : }
42063 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
42064 : partial_name = name;
42065 : } else {
42066 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
42067 0 : if (unlikely(!slice))
42068 0 : goto bad;
42069 0 : sep = PyUnicode_FromStringAndSize(".", 1);
42070 0 : if (unlikely(!sep))
42071 0 : goto bad;
42072 0 : partial_name = PyUnicode_Join(sep, slice);
42073 : }
42074 0 : PyErr_Format(
42075 : #if PY_MAJOR_VERSION < 3
42076 : PyExc_ImportError,
42077 : "No module named '%s'", PyString_AS_STRING(partial_name));
42078 : #else
42079 : #if PY_VERSION_HEX >= 0x030600B1
42080 : PyExc_ModuleNotFoundError,
42081 : #else
42082 : PyExc_ImportError,
42083 : #endif
42084 : "No module named '%U'", partial_name);
42085 : #endif
42086 0 : bad:
42087 0 : Py_XDECREF(sep);
42088 0 : Py_XDECREF(slice);
42089 0 : Py_XDECREF(partial_name);
42090 0 : return NULL;
42091 : }
42092 : #endif
42093 : #if PY_MAJOR_VERSION >= 3
42094 3 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
42095 3 : PyObject *imported_module;
42096 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
42097 : PyObject *modules = PyImport_GetModuleDict();
42098 : if (unlikely(!modules))
42099 : return NULL;
42100 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
42101 : Py_XINCREF(imported_module);
42102 : #else
42103 6 : imported_module = PyImport_GetModule(name);
42104 : #endif
42105 3 : return imported_module;
42106 : }
42107 : #endif
42108 : #if PY_MAJOR_VERSION >= 3
42109 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
42110 0 : Py_ssize_t i, nparts;
42111 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
42112 0 : for (i=1; i < nparts && module; i++) {
42113 0 : PyObject *part, *submodule;
42114 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
42115 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
42116 : #else
42117 : part = PySequence_ITEM(parts_tuple, i);
42118 : #endif
42119 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
42120 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
42121 : Py_DECREF(part);
42122 : #endif
42123 0 : Py_DECREF(module);
42124 0 : module = submodule;
42125 : }
42126 0 : if (unlikely(!module)) {
42127 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
42128 : }
42129 : return module;
42130 : }
42131 : #endif
42132 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
42133 : #if PY_MAJOR_VERSION < 3
42134 : PyObject *module, *from_list, *star = __pyx_n_s__36;
42135 : CYTHON_UNUSED_VAR(parts_tuple);
42136 : from_list = PyList_New(1);
42137 : if (unlikely(!from_list))
42138 : return NULL;
42139 : Py_INCREF(star);
42140 : PyList_SET_ITEM(from_list, 0, star);
42141 : module = __Pyx_Import(name, from_list, 0);
42142 : Py_DECREF(from_list);
42143 : return module;
42144 : #else
42145 0 : PyObject *imported_module;
42146 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
42147 0 : if (!parts_tuple || unlikely(!module))
42148 : return module;
42149 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
42150 0 : if (likely(imported_module)) {
42151 0 : Py_DECREF(module);
42152 0 : return imported_module;
42153 : }
42154 0 : PyErr_Clear();
42155 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
42156 : #endif
42157 : }
42158 3 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
42159 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
42160 3 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
42161 3 : if (likely(module)) {
42162 3 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
42163 3 : if (likely(spec)) {
42164 3 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
42165 3 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
42166 3 : Py_DECREF(spec);
42167 : spec = NULL;
42168 : }
42169 3 : Py_XDECREF(unsafe);
42170 : }
42171 3 : if (likely(!spec)) {
42172 3 : PyErr_Clear();
42173 3 : return module;
42174 : }
42175 0 : Py_DECREF(spec);
42176 0 : Py_DECREF(module);
42177 0 : } else if (PyErr_Occurred()) {
42178 0 : PyErr_Clear();
42179 : }
42180 : #endif
42181 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
42182 : }
42183 :
42184 : /* FixUpExtensionType */
42185 : #if CYTHON_USE_TYPE_SPECS
42186 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
42187 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
42188 : CYTHON_UNUSED_VAR(spec);
42189 : CYTHON_UNUSED_VAR(type);
42190 : #else
42191 : const PyType_Slot *slot = spec->slots;
42192 : while (slot && slot->slot && slot->slot != Py_tp_members)
42193 : slot++;
42194 : if (slot && slot->slot == Py_tp_members) {
42195 : int changed = 0;
42196 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
42197 : const
42198 : #endif
42199 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
42200 : while (memb && memb->name) {
42201 : if (memb->name[0] == '_' && memb->name[1] == '_') {
42202 : #if PY_VERSION_HEX < 0x030900b1
42203 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
42204 : assert(memb->type == T_PYSSIZET);
42205 : assert(memb->flags == READONLY);
42206 : type->tp_weaklistoffset = memb->offset;
42207 : changed = 1;
42208 : }
42209 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
42210 : assert(memb->type == T_PYSSIZET);
42211 : assert(memb->flags == READONLY);
42212 : type->tp_dictoffset = memb->offset;
42213 : changed = 1;
42214 : }
42215 : #if CYTHON_METH_FASTCALL
42216 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
42217 : assert(memb->type == T_PYSSIZET);
42218 : assert(memb->flags == READONLY);
42219 : #if PY_VERSION_HEX >= 0x030800b4
42220 : type->tp_vectorcall_offset = memb->offset;
42221 : #else
42222 : type->tp_print = (printfunc) memb->offset;
42223 : #endif
42224 : changed = 1;
42225 : }
42226 : #endif
42227 : #else
42228 : if ((0));
42229 : #endif
42230 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
42231 : else if (strcmp(memb->name, "__module__") == 0) {
42232 : PyObject *descr;
42233 : assert(memb->type == T_OBJECT);
42234 : assert(memb->flags == 0 || memb->flags == READONLY);
42235 : descr = PyDescr_NewMember(type, memb);
42236 : if (unlikely(!descr))
42237 : return -1;
42238 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
42239 : Py_DECREF(descr);
42240 : return -1;
42241 : }
42242 : Py_DECREF(descr);
42243 : changed = 1;
42244 : }
42245 : #endif
42246 : }
42247 : memb++;
42248 : }
42249 : if (changed)
42250 : PyType_Modified(type);
42251 : }
42252 : #endif
42253 : return 0;
42254 : }
42255 : #endif
42256 :
42257 : /* FetchSharedCythonModule */
42258 3 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
42259 3 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
42260 : }
42261 :
42262 : /* FetchCommonType */
42263 3 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
42264 : const char *name,
42265 : Py_ssize_t basicsize,
42266 : Py_ssize_t expected_basicsize) {
42267 3 : if (!PyType_Check(cached_type)) {
42268 0 : PyErr_Format(PyExc_TypeError,
42269 : "Shared Cython type %.200s is not a type object", name);
42270 0 : return -1;
42271 : }
42272 3 : if (basicsize != expected_basicsize) {
42273 0 : PyErr_Format(PyExc_TypeError,
42274 : "Shared Cython type %.200s has the wrong size, try recompiling",
42275 : name);
42276 0 : return -1;
42277 : }
42278 : return 0;
42279 : }
42280 : #if !CYTHON_USE_TYPE_SPECS
42281 3 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
42282 3 : PyObject* abi_module;
42283 3 : const char* object_name;
42284 3 : PyTypeObject *cached_type = NULL;
42285 3 : abi_module = __Pyx_FetchSharedCythonABIModule();
42286 3 : if (!abi_module) return NULL;
42287 3 : object_name = strrchr(type->tp_name, '.');
42288 3 : object_name = object_name ? object_name+1 : type->tp_name;
42289 3 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
42290 3 : if (cached_type) {
42291 3 : if (__Pyx_VerifyCachedType(
42292 : (PyObject *)cached_type,
42293 : object_name,
42294 : cached_type->tp_basicsize,
42295 : type->tp_basicsize) < 0) {
42296 0 : goto bad;
42297 : }
42298 3 : goto done;
42299 : }
42300 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
42301 0 : PyErr_Clear();
42302 0 : if (PyType_Ready(type) < 0) goto bad;
42303 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
42304 0 : goto bad;
42305 0 : Py_INCREF(type);
42306 : cached_type = type;
42307 3 : done:
42308 3 : Py_DECREF(abi_module);
42309 : return cached_type;
42310 0 : bad:
42311 0 : Py_XDECREF(cached_type);
42312 0 : cached_type = NULL;
42313 0 : goto done;
42314 : }
42315 : #else
42316 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
42317 : PyObject *abi_module, *cached_type = NULL;
42318 : const char* object_name = strrchr(spec->name, '.');
42319 : object_name = object_name ? object_name+1 : spec->name;
42320 : abi_module = __Pyx_FetchSharedCythonABIModule();
42321 : if (!abi_module) return NULL;
42322 : cached_type = PyObject_GetAttrString(abi_module, object_name);
42323 : if (cached_type) {
42324 : Py_ssize_t basicsize;
42325 : #if CYTHON_COMPILING_IN_LIMITED_API
42326 : PyObject *py_basicsize;
42327 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
42328 : if (unlikely(!py_basicsize)) goto bad;
42329 : basicsize = PyLong_AsSsize_t(py_basicsize);
42330 : Py_DECREF(py_basicsize);
42331 : py_basicsize = 0;
42332 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
42333 : #else
42334 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
42335 : #endif
42336 : if (__Pyx_VerifyCachedType(
42337 : cached_type,
42338 : object_name,
42339 : basicsize,
42340 : spec->basicsize) < 0) {
42341 : goto bad;
42342 : }
42343 : goto done;
42344 : }
42345 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
42346 : PyErr_Clear();
42347 : CYTHON_UNUSED_VAR(module);
42348 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
42349 : if (unlikely(!cached_type)) goto bad;
42350 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
42351 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
42352 : done:
42353 : Py_DECREF(abi_module);
42354 : assert(cached_type == NULL || PyType_Check(cached_type));
42355 : return (PyTypeObject *) cached_type;
42356 : bad:
42357 : Py_XDECREF(cached_type);
42358 : cached_type = NULL;
42359 : goto done;
42360 : }
42361 : #endif
42362 :
42363 : /* PyVectorcallFastCallDict */
42364 : #if CYTHON_METH_FASTCALL
42365 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
42366 : {
42367 0 : PyObject *res = NULL;
42368 0 : PyObject *kwnames;
42369 0 : PyObject **newargs;
42370 0 : PyObject **kwvalues;
42371 0 : Py_ssize_t i, pos;
42372 0 : size_t j;
42373 0 : PyObject *key, *value;
42374 0 : unsigned long keys_are_strings;
42375 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
42376 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
42377 0 : if (unlikely(newargs == NULL)) {
42378 0 : PyErr_NoMemory();
42379 0 : return NULL;
42380 : }
42381 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
42382 0 : kwnames = PyTuple_New(nkw);
42383 0 : if (unlikely(kwnames == NULL)) {
42384 0 : PyMem_Free(newargs);
42385 0 : return NULL;
42386 : }
42387 0 : kwvalues = newargs + nargs;
42388 0 : pos = i = 0;
42389 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
42390 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
42391 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
42392 0 : Py_INCREF(key);
42393 0 : Py_INCREF(value);
42394 0 : PyTuple_SET_ITEM(kwnames, i, key);
42395 0 : kwvalues[i] = value;
42396 0 : i++;
42397 : }
42398 0 : if (unlikely(!keys_are_strings)) {
42399 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
42400 0 : goto cleanup;
42401 : }
42402 0 : res = vc(func, newargs, nargs, kwnames);
42403 0 : cleanup:
42404 0 : Py_DECREF(kwnames);
42405 0 : for (i = 0; i < nkw; i++)
42406 0 : Py_DECREF(kwvalues[i]);
42407 0 : PyMem_Free(newargs);
42408 0 : return res;
42409 : }
42410 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
42411 : {
42412 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
42413 0 : return vc(func, args, nargs, NULL);
42414 : }
42415 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
42416 : }
42417 : #endif
42418 :
42419 : /* CythonFunctionShared */
42420 : #if CYTHON_COMPILING_IN_LIMITED_API
42421 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
42422 : if (__Pyx_CyFunction_Check(func)) {
42423 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
42424 : } else if (PyCFunction_Check(func)) {
42425 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
42426 : }
42427 : return 0;
42428 : }
42429 : #else
42430 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
42431 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
42432 : }
42433 : #endif
42434 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
42435 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
42436 : __Pyx_Py_XDECREF_SET(
42437 : __Pyx_CyFunction_GetClassObj(f),
42438 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
42439 : #else
42440 : __Pyx_Py_XDECREF_SET(
42441 : ((PyCMethodObject *) (f))->mm_class,
42442 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
42443 : #endif
42444 : }
42445 : static PyObject *
42446 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
42447 : {
42448 0 : CYTHON_UNUSED_VAR(closure);
42449 0 : if (unlikely(op->func_doc == NULL)) {
42450 : #if CYTHON_COMPILING_IN_LIMITED_API
42451 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
42452 : if (unlikely(!op->func_doc)) return NULL;
42453 : #else
42454 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
42455 : #if PY_MAJOR_VERSION >= 3
42456 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
42457 : #else
42458 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
42459 : #endif
42460 0 : if (unlikely(op->func_doc == NULL))
42461 : return NULL;
42462 : } else {
42463 0 : Py_INCREF(Py_None);
42464 0 : return Py_None;
42465 : }
42466 : #endif
42467 : }
42468 0 : Py_INCREF(op->func_doc);
42469 : return op->func_doc;
42470 : }
42471 : static int
42472 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
42473 : {
42474 0 : CYTHON_UNUSED_VAR(context);
42475 0 : if (value == NULL) {
42476 0 : value = Py_None;
42477 : }
42478 0 : Py_INCREF(value);
42479 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
42480 0 : return 0;
42481 : }
42482 : static PyObject *
42483 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
42484 : {
42485 0 : CYTHON_UNUSED_VAR(context);
42486 0 : if (unlikely(op->func_name == NULL)) {
42487 : #if CYTHON_COMPILING_IN_LIMITED_API
42488 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
42489 : #elif PY_MAJOR_VERSION >= 3
42490 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
42491 : #else
42492 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
42493 : #endif
42494 0 : if (unlikely(op->func_name == NULL))
42495 : return NULL;
42496 : }
42497 0 : Py_INCREF(op->func_name);
42498 : return op->func_name;
42499 : }
42500 : static int
42501 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
42502 : {
42503 0 : CYTHON_UNUSED_VAR(context);
42504 : #if PY_MAJOR_VERSION >= 3
42505 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
42506 : #else
42507 : if (unlikely(value == NULL || !PyString_Check(value)))
42508 : #endif
42509 : {
42510 0 : PyErr_SetString(PyExc_TypeError,
42511 : "__name__ must be set to a string object");
42512 0 : return -1;
42513 : }
42514 0 : Py_INCREF(value);
42515 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
42516 0 : return 0;
42517 : }
42518 : static PyObject *
42519 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
42520 : {
42521 0 : CYTHON_UNUSED_VAR(context);
42522 0 : Py_INCREF(op->func_qualname);
42523 0 : return op->func_qualname;
42524 : }
42525 : static int
42526 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
42527 : {
42528 0 : CYTHON_UNUSED_VAR(context);
42529 : #if PY_MAJOR_VERSION >= 3
42530 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
42531 : #else
42532 : if (unlikely(value == NULL || !PyString_Check(value)))
42533 : #endif
42534 : {
42535 0 : PyErr_SetString(PyExc_TypeError,
42536 : "__qualname__ must be set to a string object");
42537 0 : return -1;
42538 : }
42539 0 : Py_INCREF(value);
42540 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
42541 0 : return 0;
42542 : }
42543 : static PyObject *
42544 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
42545 : {
42546 0 : CYTHON_UNUSED_VAR(context);
42547 0 : if (unlikely(op->func_dict == NULL)) {
42548 0 : op->func_dict = PyDict_New();
42549 0 : if (unlikely(op->func_dict == NULL))
42550 : return NULL;
42551 : }
42552 0 : Py_INCREF(op->func_dict);
42553 : return op->func_dict;
42554 : }
42555 : static int
42556 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
42557 : {
42558 0 : CYTHON_UNUSED_VAR(context);
42559 0 : if (unlikely(value == NULL)) {
42560 0 : PyErr_SetString(PyExc_TypeError,
42561 : "function's dictionary may not be deleted");
42562 0 : return -1;
42563 : }
42564 0 : if (unlikely(!PyDict_Check(value))) {
42565 0 : PyErr_SetString(PyExc_TypeError,
42566 : "setting function's dictionary to a non-dict");
42567 0 : return -1;
42568 : }
42569 0 : Py_INCREF(value);
42570 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
42571 0 : return 0;
42572 : }
42573 : static PyObject *
42574 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
42575 : {
42576 0 : CYTHON_UNUSED_VAR(context);
42577 0 : Py_INCREF(op->func_globals);
42578 0 : return op->func_globals;
42579 : }
42580 : static PyObject *
42581 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
42582 : {
42583 0 : CYTHON_UNUSED_VAR(op);
42584 0 : CYTHON_UNUSED_VAR(context);
42585 0 : Py_INCREF(Py_None);
42586 0 : return Py_None;
42587 : }
42588 : static PyObject *
42589 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
42590 : {
42591 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
42592 0 : CYTHON_UNUSED_VAR(context);
42593 0 : Py_INCREF(result);
42594 0 : return result;
42595 : }
42596 : static int
42597 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
42598 0 : int result = 0;
42599 0 : PyObject *res = op->defaults_getter((PyObject *) op);
42600 0 : if (unlikely(!res))
42601 : return -1;
42602 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
42603 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
42604 0 : Py_INCREF(op->defaults_tuple);
42605 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
42606 0 : Py_INCREF(op->defaults_kwdict);
42607 : #else
42608 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
42609 : if (unlikely(!op->defaults_tuple)) result = -1;
42610 : else {
42611 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
42612 : if (unlikely(!op->defaults_kwdict)) result = -1;
42613 : }
42614 : #endif
42615 0 : Py_DECREF(res);
42616 : return result;
42617 : }
42618 : static int
42619 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
42620 0 : CYTHON_UNUSED_VAR(context);
42621 0 : if (!value) {
42622 : value = Py_None;
42623 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
42624 0 : PyErr_SetString(PyExc_TypeError,
42625 : "__defaults__ must be set to a tuple object");
42626 0 : return -1;
42627 : }
42628 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
42629 : "currently affect the values used in function calls", 1);
42630 0 : Py_INCREF(value);
42631 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
42632 0 : return 0;
42633 : }
42634 : static PyObject *
42635 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
42636 0 : PyObject* result = op->defaults_tuple;
42637 0 : CYTHON_UNUSED_VAR(context);
42638 0 : if (unlikely(!result)) {
42639 0 : if (op->defaults_getter) {
42640 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
42641 0 : result = op->defaults_tuple;
42642 : } else {
42643 : result = Py_None;
42644 : }
42645 : }
42646 0 : Py_INCREF(result);
42647 : return result;
42648 : }
42649 : static int
42650 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
42651 0 : CYTHON_UNUSED_VAR(context);
42652 0 : if (!value) {
42653 : value = Py_None;
42654 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
42655 0 : PyErr_SetString(PyExc_TypeError,
42656 : "__kwdefaults__ must be set to a dict object");
42657 0 : return -1;
42658 : }
42659 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
42660 : "currently affect the values used in function calls", 1);
42661 0 : Py_INCREF(value);
42662 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
42663 0 : return 0;
42664 : }
42665 : static PyObject *
42666 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
42667 0 : PyObject* result = op->defaults_kwdict;
42668 0 : CYTHON_UNUSED_VAR(context);
42669 0 : if (unlikely(!result)) {
42670 0 : if (op->defaults_getter) {
42671 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
42672 0 : result = op->defaults_kwdict;
42673 : } else {
42674 : result = Py_None;
42675 : }
42676 : }
42677 0 : Py_INCREF(result);
42678 : return result;
42679 : }
42680 : static int
42681 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
42682 0 : CYTHON_UNUSED_VAR(context);
42683 0 : if (!value || value == Py_None) {
42684 : value = NULL;
42685 0 : } else if (unlikely(!PyDict_Check(value))) {
42686 0 : PyErr_SetString(PyExc_TypeError,
42687 : "__annotations__ must be set to a dict object");
42688 0 : return -1;
42689 : }
42690 0 : Py_XINCREF(value);
42691 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
42692 0 : return 0;
42693 : }
42694 : static PyObject *
42695 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
42696 0 : PyObject* result = op->func_annotations;
42697 0 : CYTHON_UNUSED_VAR(context);
42698 0 : if (unlikely(!result)) {
42699 0 : result = PyDict_New();
42700 0 : if (unlikely(!result)) return NULL;
42701 0 : op->func_annotations = result;
42702 : }
42703 0 : Py_INCREF(result);
42704 : return result;
42705 : }
42706 : static PyObject *
42707 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
42708 0 : int is_coroutine;
42709 0 : CYTHON_UNUSED_VAR(context);
42710 0 : if (op->func_is_coroutine) {
42711 0 : return __Pyx_NewRef(op->func_is_coroutine);
42712 : }
42713 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
42714 : #if PY_VERSION_HEX >= 0x03050000
42715 0 : if (is_coroutine) {
42716 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
42717 0 : fromlist = PyList_New(1);
42718 0 : if (unlikely(!fromlist)) return NULL;
42719 0 : Py_INCREF(marker);
42720 : #if CYTHON_ASSUME_SAFE_MACROS
42721 0 : PyList_SET_ITEM(fromlist, 0, marker);
42722 : #else
42723 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
42724 : Py_DECREF(marker);
42725 : Py_DECREF(fromlist);
42726 : return NULL;
42727 : }
42728 : #endif
42729 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
42730 0 : Py_DECREF(fromlist);
42731 0 : if (unlikely(!module)) goto ignore;
42732 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
42733 0 : Py_DECREF(module);
42734 0 : if (likely(op->func_is_coroutine)) {
42735 0 : return __Pyx_NewRef(op->func_is_coroutine);
42736 : }
42737 0 : ignore:
42738 0 : PyErr_Clear();
42739 : }
42740 : #endif
42741 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
42742 0 : return __Pyx_NewRef(op->func_is_coroutine);
42743 : }
42744 : #if CYTHON_COMPILING_IN_LIMITED_API
42745 : static PyObject *
42746 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
42747 : CYTHON_UNUSED_VAR(context);
42748 : return PyObject_GetAttrString(op->func, "__module__");
42749 : }
42750 : static int
42751 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
42752 : CYTHON_UNUSED_VAR(context);
42753 : return PyObject_SetAttrString(op->func, "__module__", value);
42754 : }
42755 : #endif
42756 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
42757 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
42758 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
42759 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
42760 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
42761 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
42762 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
42763 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
42764 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
42765 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
42766 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
42767 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
42768 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
42769 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
42770 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
42771 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
42772 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
42773 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
42774 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
42775 : #if CYTHON_COMPILING_IN_LIMITED_API
42776 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
42777 : #endif
42778 : {0, 0, 0, 0, 0}
42779 : };
42780 : static PyMemberDef __pyx_CyFunction_members[] = {
42781 : #if !CYTHON_COMPILING_IN_LIMITED_API
42782 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
42783 : #endif
42784 : #if CYTHON_USE_TYPE_SPECS
42785 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
42786 : #if CYTHON_METH_FASTCALL
42787 : #if CYTHON_BACKPORT_VECTORCALL
42788 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
42789 : #else
42790 : #if !CYTHON_COMPILING_IN_LIMITED_API
42791 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
42792 : #endif
42793 : #endif
42794 : #endif
42795 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
42796 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
42797 : #else
42798 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
42799 : #endif
42800 : #endif
42801 : {0, 0, 0, 0, 0}
42802 : };
42803 : static PyObject *
42804 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
42805 : {
42806 0 : CYTHON_UNUSED_VAR(args);
42807 : #if PY_MAJOR_VERSION >= 3
42808 0 : Py_INCREF(m->func_qualname);
42809 0 : return m->func_qualname;
42810 : #else
42811 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
42812 : #endif
42813 : }
42814 : static PyMethodDef __pyx_CyFunction_methods[] = {
42815 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
42816 : {0, 0, 0, 0}
42817 : };
42818 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
42819 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
42820 : #else
42821 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
42822 : #endif
42823 12 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
42824 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
42825 : #if !CYTHON_COMPILING_IN_LIMITED_API
42826 12 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
42827 : #endif
42828 12 : if (unlikely(op == NULL))
42829 : return NULL;
42830 : #if CYTHON_COMPILING_IN_LIMITED_API
42831 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
42832 : if (unlikely(!op->func)) return NULL;
42833 : #endif
42834 12 : op->flags = flags;
42835 12 : __Pyx_CyFunction_weakreflist(op) = NULL;
42836 : #if !CYTHON_COMPILING_IN_LIMITED_API
42837 12 : cf->m_ml = ml;
42838 12 : cf->m_self = (PyObject *) op;
42839 : #endif
42840 12 : Py_XINCREF(closure);
42841 12 : op->func_closure = closure;
42842 : #if !CYTHON_COMPILING_IN_LIMITED_API
42843 12 : Py_XINCREF(module);
42844 12 : cf->m_module = module;
42845 : #endif
42846 12 : op->func_dict = NULL;
42847 12 : op->func_name = NULL;
42848 12 : Py_INCREF(qualname);
42849 12 : op->func_qualname = qualname;
42850 12 : op->func_doc = NULL;
42851 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
42852 : op->func_classobj = NULL;
42853 : #else
42854 12 : ((PyCMethodObject*)op)->mm_class = NULL;
42855 : #endif
42856 12 : op->func_globals = globals;
42857 12 : Py_INCREF(op->func_globals);
42858 12 : Py_XINCREF(code);
42859 12 : op->func_code = code;
42860 12 : op->defaults_pyobjects = 0;
42861 12 : op->defaults_size = 0;
42862 12 : op->defaults = NULL;
42863 12 : op->defaults_tuple = NULL;
42864 12 : op->defaults_kwdict = NULL;
42865 12 : op->defaults_getter = NULL;
42866 12 : op->func_annotations = NULL;
42867 12 : op->func_is_coroutine = NULL;
42868 : #if CYTHON_METH_FASTCALL
42869 12 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
42870 0 : case METH_NOARGS:
42871 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
42872 0 : break;
42873 0 : case METH_O:
42874 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
42875 0 : break;
42876 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
42877 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
42878 0 : break;
42879 12 : case METH_FASTCALL | METH_KEYWORDS:
42880 12 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
42881 12 : break;
42882 0 : case METH_VARARGS | METH_KEYWORDS:
42883 0 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
42884 0 : break;
42885 0 : default:
42886 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
42887 0 : Py_DECREF(op);
42888 : return NULL;
42889 : }
42890 : #endif
42891 : return (PyObject *) op;
42892 : }
42893 : static int
42894 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
42895 : {
42896 0 : Py_CLEAR(m->func_closure);
42897 : #if CYTHON_COMPILING_IN_LIMITED_API
42898 : Py_CLEAR(m->func);
42899 : #else
42900 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
42901 : #endif
42902 0 : Py_CLEAR(m->func_dict);
42903 0 : Py_CLEAR(m->func_name);
42904 0 : Py_CLEAR(m->func_qualname);
42905 0 : Py_CLEAR(m->func_doc);
42906 0 : Py_CLEAR(m->func_globals);
42907 0 : Py_CLEAR(m->func_code);
42908 : #if !CYTHON_COMPILING_IN_LIMITED_API
42909 : #if PY_VERSION_HEX < 0x030900B1
42910 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
42911 : #else
42912 : {
42913 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
42914 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
42915 0 : Py_XDECREF(cls);
42916 : }
42917 : #endif
42918 : #endif
42919 0 : Py_CLEAR(m->defaults_tuple);
42920 0 : Py_CLEAR(m->defaults_kwdict);
42921 0 : Py_CLEAR(m->func_annotations);
42922 0 : Py_CLEAR(m->func_is_coroutine);
42923 0 : if (m->defaults) {
42924 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
42925 : int i;
42926 0 : for (i = 0; i < m->defaults_pyobjects; i++)
42927 0 : Py_XDECREF(pydefaults[i]);
42928 0 : PyObject_Free(m->defaults);
42929 0 : m->defaults = NULL;
42930 : }
42931 0 : return 0;
42932 : }
42933 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
42934 : {
42935 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
42936 0 : PyObject_ClearWeakRefs((PyObject *) m);
42937 0 : __Pyx_CyFunction_clear(m);
42938 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
42939 0 : }
42940 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
42941 : {
42942 0 : PyObject_GC_UnTrack(m);
42943 0 : __Pyx__CyFunction_dealloc(m);
42944 0 : }
42945 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
42946 : {
42947 0 : Py_VISIT(m->func_closure);
42948 : #if CYTHON_COMPILING_IN_LIMITED_API
42949 : Py_VISIT(m->func);
42950 : #else
42951 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
42952 : #endif
42953 0 : Py_VISIT(m->func_dict);
42954 0 : Py_VISIT(m->func_name);
42955 0 : Py_VISIT(m->func_qualname);
42956 0 : Py_VISIT(m->func_doc);
42957 0 : Py_VISIT(m->func_globals);
42958 0 : Py_VISIT(m->func_code);
42959 : #if !CYTHON_COMPILING_IN_LIMITED_API
42960 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
42961 : #endif
42962 0 : Py_VISIT(m->defaults_tuple);
42963 0 : Py_VISIT(m->defaults_kwdict);
42964 0 : Py_VISIT(m->func_is_coroutine);
42965 0 : if (m->defaults) {
42966 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
42967 : int i;
42968 0 : for (i = 0; i < m->defaults_pyobjects; i++)
42969 0 : Py_VISIT(pydefaults[i]);
42970 : }
42971 : return 0;
42972 : }
42973 : static PyObject*
42974 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
42975 : {
42976 : #if PY_MAJOR_VERSION >= 3
42977 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
42978 : op->func_qualname, (void *)op);
42979 : #else
42980 : return PyString_FromFormat("<cyfunction %s at %p>",
42981 : PyString_AsString(op->func_qualname), (void *)op);
42982 : #endif
42983 : }
42984 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
42985 : #if CYTHON_COMPILING_IN_LIMITED_API
42986 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
42987 : PyObject *py_name = NULL;
42988 : PyCFunction meth;
42989 : int flags;
42990 : meth = PyCFunction_GetFunction(f);
42991 : if (unlikely(!meth)) return NULL;
42992 : flags = PyCFunction_GetFlags(f);
42993 : if (unlikely(flags < 0)) return NULL;
42994 : #else
42995 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
42996 0 : PyCFunction meth = f->m_ml->ml_meth;
42997 0 : int flags = f->m_ml->ml_flags;
42998 : #endif
42999 0 : Py_ssize_t size;
43000 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
43001 0 : case METH_VARARGS:
43002 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
43003 0 : return (*meth)(self, arg);
43004 : break;
43005 0 : case METH_VARARGS | METH_KEYWORDS:
43006 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
43007 0 : case METH_NOARGS:
43008 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
43009 : #if CYTHON_ASSUME_SAFE_MACROS
43010 0 : size = PyTuple_GET_SIZE(arg);
43011 : #else
43012 : size = PyTuple_Size(arg);
43013 : if (unlikely(size < 0)) return NULL;
43014 : #endif
43015 0 : if (likely(size == 0))
43016 0 : return (*meth)(self, NULL);
43017 : #if CYTHON_COMPILING_IN_LIMITED_API
43018 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
43019 : if (!py_name) return NULL;
43020 : PyErr_Format(PyExc_TypeError,
43021 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
43022 : py_name, size);
43023 : Py_DECREF(py_name);
43024 : #else
43025 0 : PyErr_Format(PyExc_TypeError,
43026 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
43027 0 : f->m_ml->ml_name, size);
43028 : #endif
43029 0 : return NULL;
43030 : }
43031 : break;
43032 0 : case METH_O:
43033 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
43034 : #if CYTHON_ASSUME_SAFE_MACROS
43035 0 : size = PyTuple_GET_SIZE(arg);
43036 : #else
43037 : size = PyTuple_Size(arg);
43038 : if (unlikely(size < 0)) return NULL;
43039 : #endif
43040 0 : if (likely(size == 1)) {
43041 0 : PyObject *result, *arg0;
43042 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
43043 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
43044 : #else
43045 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
43046 : #endif
43047 0 : result = (*meth)(self, arg0);
43048 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
43049 : Py_DECREF(arg0);
43050 : #endif
43051 0 : return result;
43052 : }
43053 : #if CYTHON_COMPILING_IN_LIMITED_API
43054 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
43055 : if (!py_name) return NULL;
43056 : PyErr_Format(PyExc_TypeError,
43057 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
43058 : py_name, size);
43059 : Py_DECREF(py_name);
43060 : #else
43061 0 : PyErr_Format(PyExc_TypeError,
43062 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
43063 0 : f->m_ml->ml_name, size);
43064 : #endif
43065 0 : return NULL;
43066 : }
43067 : break;
43068 0 : default:
43069 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
43070 0 : return NULL;
43071 : }
43072 : #if CYTHON_COMPILING_IN_LIMITED_API
43073 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
43074 : if (!py_name) return NULL;
43075 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
43076 : py_name);
43077 : Py_DECREF(py_name);
43078 : #else
43079 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
43080 0 : f->m_ml->ml_name);
43081 : #endif
43082 0 : return NULL;
43083 : }
43084 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
43085 0 : PyObject *self, *result;
43086 : #if CYTHON_COMPILING_IN_LIMITED_API
43087 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
43088 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
43089 : #else
43090 0 : self = ((PyCFunctionObject*)func)->m_self;
43091 : #endif
43092 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
43093 0 : return result;
43094 : }
43095 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
43096 0 : PyObject *result;
43097 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
43098 : #if CYTHON_METH_FASTCALL
43099 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
43100 0 : if (vc) {
43101 : #if CYTHON_ASSUME_SAFE_MACROS
43102 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
43103 : #else
43104 : (void) &__Pyx_PyVectorcall_FastCallDict;
43105 : return PyVectorcall_Call(func, args, kw);
43106 : #endif
43107 : }
43108 : #endif
43109 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
43110 0 : Py_ssize_t argc;
43111 0 : PyObject *new_args;
43112 0 : PyObject *self;
43113 : #if CYTHON_ASSUME_SAFE_MACROS
43114 0 : argc = PyTuple_GET_SIZE(args);
43115 : #else
43116 : argc = PyTuple_Size(args);
43117 : if (unlikely(!argc) < 0) return NULL;
43118 : #endif
43119 0 : new_args = PyTuple_GetSlice(args, 1, argc);
43120 0 : if (unlikely(!new_args))
43121 : return NULL;
43122 0 : self = PyTuple_GetItem(args, 0);
43123 0 : if (unlikely(!self)) {
43124 0 : Py_DECREF(new_args);
43125 : #if PY_MAJOR_VERSION > 2
43126 0 : PyErr_Format(PyExc_TypeError,
43127 : "unbound method %.200S() needs an argument",
43128 : cyfunc->func_qualname);
43129 : #else
43130 : PyErr_SetString(PyExc_TypeError,
43131 : "unbound method needs an argument");
43132 : #endif
43133 0 : return NULL;
43134 : }
43135 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
43136 0 : Py_DECREF(new_args);
43137 : } else {
43138 0 : result = __Pyx_CyFunction_Call(func, args, kw);
43139 : }
43140 : return result;
43141 : }
43142 : #if CYTHON_METH_FASTCALL
43143 25254 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
43144 : {
43145 25254 : int ret = 0;
43146 25254 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
43147 0 : if (unlikely(nargs < 1)) {
43148 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
43149 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
43150 0 : return -1;
43151 : }
43152 : ret = 1;
43153 : }
43154 25254 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
43155 0 : PyErr_Format(PyExc_TypeError,
43156 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
43157 0 : return -1;
43158 : }
43159 : return ret;
43160 : }
43161 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
43162 : {
43163 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
43164 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
43165 : #if CYTHON_BACKPORT_VECTORCALL
43166 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
43167 : #else
43168 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
43169 : #endif
43170 0 : PyObject *self;
43171 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
43172 0 : case 1:
43173 0 : self = args[0];
43174 0 : args += 1;
43175 0 : nargs -= 1;
43176 0 : break;
43177 0 : case 0:
43178 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
43179 0 : break;
43180 : default:
43181 : return NULL;
43182 : }
43183 0 : if (unlikely(nargs != 0)) {
43184 0 : PyErr_Format(PyExc_TypeError,
43185 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
43186 : def->ml_name, nargs);
43187 0 : return NULL;
43188 : }
43189 0 : return def->ml_meth(self, NULL);
43190 : }
43191 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
43192 : {
43193 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
43194 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
43195 : #if CYTHON_BACKPORT_VECTORCALL
43196 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
43197 : #else
43198 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
43199 : #endif
43200 0 : PyObject *self;
43201 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
43202 0 : case 1:
43203 0 : self = args[0];
43204 0 : args += 1;
43205 0 : nargs -= 1;
43206 0 : break;
43207 0 : case 0:
43208 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
43209 0 : break;
43210 : default:
43211 : return NULL;
43212 : }
43213 0 : if (unlikely(nargs != 1)) {
43214 0 : PyErr_Format(PyExc_TypeError,
43215 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
43216 : def->ml_name, nargs);
43217 0 : return NULL;
43218 : }
43219 0 : return def->ml_meth(self, args[0]);
43220 : }
43221 25254 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
43222 : {
43223 25254 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
43224 25254 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
43225 : #if CYTHON_BACKPORT_VECTORCALL
43226 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
43227 : #else
43228 25254 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
43229 : #endif
43230 25254 : PyObject *self;
43231 25254 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
43232 0 : case 1:
43233 0 : self = args[0];
43234 0 : args += 1;
43235 0 : nargs -= 1;
43236 0 : break;
43237 25254 : case 0:
43238 25254 : self = ((PyCFunctionObject*)cyfunc)->m_self;
43239 25254 : break;
43240 : default:
43241 : return NULL;
43242 : }
43243 25254 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
43244 : }
43245 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
43246 : {
43247 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
43248 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
43249 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
43250 : #if CYTHON_BACKPORT_VECTORCALL
43251 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
43252 : #else
43253 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
43254 : #endif
43255 0 : PyObject *self;
43256 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
43257 0 : case 1:
43258 0 : self = args[0];
43259 0 : args += 1;
43260 0 : nargs -= 1;
43261 0 : break;
43262 0 : case 0:
43263 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
43264 0 : break;
43265 : default:
43266 : return NULL;
43267 : }
43268 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
43269 : }
43270 : #endif
43271 : #if CYTHON_USE_TYPE_SPECS
43272 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
43273 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
43274 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
43275 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
43276 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
43277 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
43278 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
43279 : {Py_tp_members, (void *)__pyx_CyFunction_members},
43280 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
43281 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
43282 : {0, 0},
43283 : };
43284 : static PyType_Spec __pyx_CyFunctionType_spec = {
43285 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
43286 : sizeof(__pyx_CyFunctionObject),
43287 : 0,
43288 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
43289 : Py_TPFLAGS_METHOD_DESCRIPTOR |
43290 : #endif
43291 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
43292 : _Py_TPFLAGS_HAVE_VECTORCALL |
43293 : #endif
43294 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
43295 : __pyx_CyFunctionType_slots
43296 : };
43297 : #else
43298 : static PyTypeObject __pyx_CyFunctionType_type = {
43299 : PyVarObject_HEAD_INIT(0, 0)
43300 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
43301 : sizeof(__pyx_CyFunctionObject),
43302 : 0,
43303 : (destructor) __Pyx_CyFunction_dealloc,
43304 : #if !CYTHON_METH_FASTCALL
43305 : 0,
43306 : #elif CYTHON_BACKPORT_VECTORCALL
43307 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
43308 : #else
43309 : offsetof(PyCFunctionObject, vectorcall),
43310 : #endif
43311 : 0,
43312 : 0,
43313 : #if PY_MAJOR_VERSION < 3
43314 : 0,
43315 : #else
43316 : 0,
43317 : #endif
43318 : (reprfunc) __Pyx_CyFunction_repr,
43319 : 0,
43320 : 0,
43321 : 0,
43322 : 0,
43323 : __Pyx_CyFunction_CallAsMethod,
43324 : 0,
43325 : 0,
43326 : 0,
43327 : 0,
43328 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
43329 : Py_TPFLAGS_METHOD_DESCRIPTOR |
43330 : #endif
43331 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
43332 : _Py_TPFLAGS_HAVE_VECTORCALL |
43333 : #endif
43334 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
43335 : 0,
43336 : (traverseproc) __Pyx_CyFunction_traverse,
43337 : (inquiry) __Pyx_CyFunction_clear,
43338 : 0,
43339 : #if PY_VERSION_HEX < 0x030500A0
43340 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
43341 : #else
43342 : offsetof(PyCFunctionObject, m_weakreflist),
43343 : #endif
43344 : 0,
43345 : 0,
43346 : __pyx_CyFunction_methods,
43347 : __pyx_CyFunction_members,
43348 : __pyx_CyFunction_getsets,
43349 : 0,
43350 : 0,
43351 : __Pyx_PyMethod_New,
43352 : 0,
43353 : offsetof(__pyx_CyFunctionObject, func_dict),
43354 : 0,
43355 : 0,
43356 : 0,
43357 : 0,
43358 : 0,
43359 : 0,
43360 : 0,
43361 : 0,
43362 : 0,
43363 : 0,
43364 : 0,
43365 : 0,
43366 : #if PY_VERSION_HEX >= 0x030400a1
43367 : 0,
43368 : #endif
43369 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
43370 : 0,
43371 : #endif
43372 : #if __PYX_NEED_TP_PRINT_SLOT
43373 : 0,
43374 : #endif
43375 : #if PY_VERSION_HEX >= 0x030C0000
43376 : 0,
43377 : #endif
43378 : #if PY_VERSION_HEX >= 0x030d00A4
43379 : 0,
43380 : #endif
43381 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
43382 : 0,
43383 : #endif
43384 : };
43385 : #endif
43386 3 : static int __pyx_CyFunction_init(PyObject *module) {
43387 : #if CYTHON_USE_TYPE_SPECS
43388 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
43389 : #else
43390 3 : CYTHON_UNUSED_VAR(module);
43391 3 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
43392 : #endif
43393 3 : if (unlikely(__pyx_CyFunctionType == NULL)) {
43394 0 : return -1;
43395 : }
43396 : return 0;
43397 : }
43398 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
43399 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
43400 : m->defaults = PyObject_Malloc(size);
43401 : if (unlikely(!m->defaults))
43402 : return PyErr_NoMemory();
43403 : memset(m->defaults, 0, size);
43404 : m->defaults_pyobjects = pyobjects;
43405 : m->defaults_size = size;
43406 : return m->defaults;
43407 : }
43408 9 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
43409 9 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
43410 9 : m->defaults_tuple = tuple;
43411 18 : Py_INCREF(tuple);
43412 : }
43413 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
43414 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
43415 : m->defaults_kwdict = dict;
43416 : Py_INCREF(dict);
43417 : }
43418 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
43419 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
43420 : m->func_annotations = dict;
43421 : Py_INCREF(dict);
43422 : }
43423 :
43424 : /* CythonFunction */
43425 12 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
43426 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
43427 12 : PyObject *op = __Pyx_CyFunction_Init(
43428 12 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
43429 : ml, flags, qualname, closure, module, globals, code
43430 : );
43431 12 : if (likely(op)) {
43432 12 : PyObject_GC_Track(op);
43433 : }
43434 12 : return op;
43435 : }
43436 :
43437 : /* CLineInTraceback */
43438 : #ifndef CYTHON_CLINE_IN_TRACEBACK
43439 2624 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
43440 2624 : PyObject *use_cline;
43441 2624 : PyObject *ptype, *pvalue, *ptraceback;
43442 : #if CYTHON_COMPILING_IN_CPYTHON
43443 2624 : PyObject **cython_runtime_dict;
43444 : #endif
43445 2624 : CYTHON_MAYBE_UNUSED_VAR(tstate);
43446 2624 : if (unlikely(!__pyx_cython_runtime)) {
43447 : return c_line;
43448 : }
43449 2624 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
43450 : #if CYTHON_COMPILING_IN_CPYTHON
43451 2624 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
43452 2624 : if (likely(cython_runtime_dict)) {
43453 2624 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
43454 : use_cline, *cython_runtime_dict,
43455 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
43456 : } else
43457 : #endif
43458 : {
43459 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
43460 0 : if (use_cline_obj) {
43461 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
43462 0 : Py_DECREF(use_cline_obj);
43463 : } else {
43464 0 : PyErr_Clear();
43465 0 : use_cline = NULL;
43466 : }
43467 : }
43468 2624 : if (!use_cline) {
43469 0 : c_line = 0;
43470 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
43471 : }
43472 2624 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
43473 : c_line = 0;
43474 : }
43475 2624 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
43476 2624 : return c_line;
43477 : }
43478 : #endif
43479 :
43480 : /* CodeObjectCache */
43481 : #if !CYTHON_COMPILING_IN_LIMITED_API
43482 2658 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
43483 2658 : int start = 0, mid = 0, end = count - 1;
43484 2658 : if (end >= 0 && code_line > entries[end].code_line) {
43485 : return count;
43486 : }
43487 10366 : while (start < end) {
43488 10272 : mid = start + (end - start) / 2;
43489 10272 : if (code_line < entries[mid].code_line) {
43490 : end = mid;
43491 5860 : } else if (code_line > entries[mid].code_line) {
43492 3310 : start = mid + 1;
43493 : } else {
43494 2550 : return mid;
43495 : }
43496 : }
43497 94 : if (code_line <= entries[mid].code_line) {
43498 : return mid;
43499 : } else {
43500 82 : return mid + 1;
43501 : }
43502 : }
43503 2624 : static PyCodeObject *__pyx_find_code_object(int code_line) {
43504 2624 : PyCodeObject* code_object;
43505 2624 : int pos;
43506 2624 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
43507 : return NULL;
43508 : }
43509 2623 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
43510 2623 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
43511 : return NULL;
43512 : }
43513 2588 : code_object = __pyx_code_cache.entries[pos].code_object;
43514 2588 : Py_INCREF(code_object);
43515 : return code_object;
43516 : }
43517 36 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
43518 36 : int pos, i;
43519 36 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
43520 36 : if (unlikely(!code_line)) {
43521 : return;
43522 : }
43523 36 : if (unlikely(!entries)) {
43524 1 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
43525 1 : if (likely(entries)) {
43526 1 : __pyx_code_cache.entries = entries;
43527 1 : __pyx_code_cache.max_count = 64;
43528 1 : __pyx_code_cache.count = 1;
43529 1 : entries[0].code_line = code_line;
43530 1 : entries[0].code_object = code_object;
43531 1 : Py_INCREF(code_object);
43532 : }
43533 1 : return;
43534 : }
43535 35 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
43536 35 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
43537 0 : PyCodeObject* tmp = entries[pos].code_object;
43538 0 : entries[pos].code_object = code_object;
43539 0 : Py_DECREF(tmp);
43540 0 : return;
43541 : }
43542 35 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
43543 0 : int new_max = __pyx_code_cache.max_count + 64;
43544 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
43545 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
43546 0 : if (unlikely(!entries)) {
43547 : return;
43548 : }
43549 0 : __pyx_code_cache.entries = entries;
43550 0 : __pyx_code_cache.max_count = new_max;
43551 : }
43552 178 : for (i=__pyx_code_cache.count; i>pos; i--) {
43553 143 : entries[i] = entries[i-1];
43554 : }
43555 35 : entries[pos].code_line = code_line;
43556 35 : entries[pos].code_object = code_object;
43557 35 : __pyx_code_cache.count++;
43558 35 : Py_INCREF(code_object);
43559 : }
43560 : #endif
43561 :
43562 : /* AddTraceback */
43563 : #include "compile.h"
43564 : #include "frameobject.h"
43565 : #include "traceback.h"
43566 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
43567 : #ifndef Py_BUILD_CORE
43568 : #define Py_BUILD_CORE 1
43569 : #endif
43570 : #include "internal/pycore_frame.h"
43571 : #endif
43572 : #if CYTHON_COMPILING_IN_LIMITED_API
43573 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
43574 : PyObject *firstlineno, PyObject *name) {
43575 : PyObject *replace = NULL;
43576 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
43577 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
43578 : replace = PyObject_GetAttrString(code, "replace");
43579 : if (likely(replace)) {
43580 : PyObject *result;
43581 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
43582 : Py_DECREF(replace);
43583 : return result;
43584 : }
43585 : PyErr_Clear();
43586 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
43587 : {
43588 : PyObject *compiled = NULL, *result = NULL;
43589 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
43590 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
43591 : compiled = Py_CompileString(
43592 : "out = type(code)(\n"
43593 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
43594 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
43595 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
43596 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
43597 : if (!compiled) return NULL;
43598 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
43599 : Py_DECREF(compiled);
43600 : if (!result) PyErr_Print();
43601 : Py_DECREF(result);
43602 : result = PyDict_GetItemString(scratch_dict, "out");
43603 : if (result) Py_INCREF(result);
43604 : return result;
43605 : }
43606 : #else
43607 : return NULL;
43608 : #endif
43609 : }
43610 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
43611 : int py_line, const char *filename) {
43612 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
43613 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
43614 : PyObject *exc_type, *exc_value, *exc_traceback;
43615 : int success = 0;
43616 : if (c_line) {
43617 : (void) __pyx_cfilenm;
43618 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
43619 : }
43620 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
43621 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
43622 : if (unlikely(!code_object)) goto bad;
43623 : py_py_line = PyLong_FromLong(py_line);
43624 : if (unlikely(!py_py_line)) goto bad;
43625 : py_funcname = PyUnicode_FromString(funcname);
43626 : if (unlikely(!py_funcname)) goto bad;
43627 : dict = PyDict_New();
43628 : if (unlikely(!dict)) goto bad;
43629 : {
43630 : PyObject *old_code_object = code_object;
43631 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
43632 : Py_DECREF(old_code_object);
43633 : }
43634 : if (unlikely(!code_object)) goto bad;
43635 : getframe = PySys_GetObject("_getframe");
43636 : if (unlikely(!getframe)) goto bad;
43637 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
43638 : frame = PyEval_EvalCode(code_object, dict, dict);
43639 : if (unlikely(!frame) || frame == Py_None) goto bad;
43640 : success = 1;
43641 : bad:
43642 : PyErr_Restore(exc_type, exc_value, exc_traceback);
43643 : Py_XDECREF(code_object);
43644 : Py_XDECREF(py_py_line);
43645 : Py_XDECREF(py_funcname);
43646 : Py_XDECREF(dict);
43647 : Py_XDECREF(replace);
43648 : if (success) {
43649 : PyTraceBack_Here(
43650 : (struct _frame*)frame);
43651 : }
43652 : Py_XDECREF(frame);
43653 : }
43654 : #else
43655 36 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
43656 : const char *funcname, int c_line,
43657 : int py_line, const char *filename) {
43658 36 : PyCodeObject *py_code = NULL;
43659 36 : PyObject *py_funcname = NULL;
43660 : #if PY_MAJOR_VERSION < 3
43661 : PyObject *py_srcfile = NULL;
43662 : py_srcfile = PyString_FromString(filename);
43663 : if (!py_srcfile) goto bad;
43664 : #endif
43665 36 : if (c_line) {
43666 : #if PY_MAJOR_VERSION < 3
43667 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
43668 : if (!py_funcname) goto bad;
43669 : #else
43670 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
43671 0 : if (!py_funcname) goto bad;
43672 0 : funcname = PyUnicode_AsUTF8(py_funcname);
43673 0 : if (!funcname) goto bad;
43674 : #endif
43675 : }
43676 : else {
43677 : #if PY_MAJOR_VERSION < 3
43678 : py_funcname = PyString_FromString(funcname);
43679 : if (!py_funcname) goto bad;
43680 : #endif
43681 36 : }
43682 : #if PY_MAJOR_VERSION < 3
43683 : py_code = __Pyx_PyCode_New(
43684 : 0,
43685 : 0,
43686 : 0,
43687 : 0,
43688 : 0,
43689 : 0,
43690 : __pyx_empty_bytes, /*PyObject *code,*/
43691 : __pyx_empty_tuple, /*PyObject *consts,*/
43692 : __pyx_empty_tuple, /*PyObject *names,*/
43693 : __pyx_empty_tuple, /*PyObject *varnames,*/
43694 : __pyx_empty_tuple, /*PyObject *freevars,*/
43695 : __pyx_empty_tuple, /*PyObject *cellvars,*/
43696 : py_srcfile, /*PyObject *filename,*/
43697 : py_funcname, /*PyObject *name,*/
43698 : py_line,
43699 : __pyx_empty_bytes /*PyObject *lnotab*/
43700 : );
43701 : Py_DECREF(py_srcfile);
43702 : #else
43703 36 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
43704 : #endif
43705 36 : Py_XDECREF(py_funcname);
43706 36 : return py_code;
43707 0 : bad:
43708 0 : Py_XDECREF(py_funcname);
43709 : #if PY_MAJOR_VERSION < 3
43710 : Py_XDECREF(py_srcfile);
43711 : #endif
43712 0 : return NULL;
43713 : }
43714 2624 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
43715 : int py_line, const char *filename) {
43716 2624 : PyCodeObject *py_code = 0;
43717 2624 : PyFrameObject *py_frame = 0;
43718 2624 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
43719 2624 : PyObject *ptype, *pvalue, *ptraceback;
43720 2624 : if (c_line) {
43721 2624 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
43722 : }
43723 5248 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
43724 2624 : if (!py_code) {
43725 36 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
43726 36 : py_code = __Pyx_CreateCodeObjectForTraceback(
43727 : funcname, c_line, py_line, filename);
43728 36 : if (!py_code) {
43729 : /* If the code object creation fails, then we should clear the
43730 : fetched exception references and propagate the new exception */
43731 0 : Py_XDECREF(ptype);
43732 0 : Py_XDECREF(pvalue);
43733 0 : Py_XDECREF(ptraceback);
43734 0 : goto bad;
43735 : }
43736 36 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
43737 36 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
43738 : }
43739 5248 : py_frame = PyFrame_New(
43740 : tstate, /*PyThreadState *tstate,*/
43741 : py_code, /*PyCodeObject *code,*/
43742 2624 : __pyx_d, /*PyObject *globals,*/
43743 : 0 /*PyObject *locals*/
43744 : );
43745 2624 : if (!py_frame) goto bad;
43746 2624 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
43747 2624 : PyTraceBack_Here(py_frame);
43748 2624 : bad:
43749 2624 : Py_XDECREF(py_code);
43750 2624 : Py_XDECREF(py_frame);
43751 2624 : }
43752 : #endif
43753 :
43754 : /* Declarations */
43755 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
43756 : #ifdef __cplusplus
43757 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
43758 : return ::std::complex< float >(x, y);
43759 : }
43760 : #else
43761 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
43762 : return x + y*(__pyx_t_float_complex)_Complex_I;
43763 : }
43764 : #endif
43765 : #else
43766 1212 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
43767 1212 : __pyx_t_float_complex z;
43768 67096 : z.real = x;
43769 27049 : z.imag = y;
43770 307 : return z;
43771 : }
43772 : #endif
43773 :
43774 : /* Arithmetic */
43775 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
43776 : #else
43777 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
43778 : return (a.real == b.real) && (a.imag == b.imag);
43779 : }
43780 299 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
43781 299 : __pyx_t_float_complex z;
43782 299 : z.real = a.real + b.real;
43783 299 : z.imag = a.imag + b.imag;
43784 299 : return z;
43785 : }
43786 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
43787 : __pyx_t_float_complex z;
43788 : z.real = a.real - b.real;
43789 : z.imag = a.imag - b.imag;
43790 : return z;
43791 : }
43792 862 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
43793 862 : __pyx_t_float_complex z;
43794 862 : z.real = a.real * b.real - a.imag * b.imag;
43795 862 : z.imag = a.real * b.imag + a.imag * b.real;
43796 684 : return z;
43797 : }
43798 : #if 1
43799 905 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
43800 905 : if (b.imag == 0) {
43801 905 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
43802 0 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
43803 0 : if (b.real == 0 && b.imag == 0) {
43804 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
43805 : } else {
43806 0 : float r = b.imag / b.real;
43807 0 : float s = (float)(1.0) / (b.real + b.imag * r);
43808 0 : return __pyx_t_float_complex_from_parts(
43809 0 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
43810 : }
43811 : } else {
43812 0 : float r = b.real / b.imag;
43813 0 : float s = (float)(1.0) / (b.imag + b.real * r);
43814 0 : return __pyx_t_float_complex_from_parts(
43815 0 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
43816 : }
43817 : }
43818 : #else
43819 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
43820 : if (b.imag == 0) {
43821 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
43822 : } else {
43823 : float denom = b.real * b.real + b.imag * b.imag;
43824 : return __pyx_t_float_complex_from_parts(
43825 : (a.real * b.real + a.imag * b.imag) / denom,
43826 : (a.imag * b.real - a.real * b.imag) / denom);
43827 : }
43828 : }
43829 : #endif
43830 390 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
43831 390 : __pyx_t_float_complex z;
43832 390 : z.real = -a.real;
43833 390 : z.imag = -a.imag;
43834 58 : return z;
43835 : }
43836 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
43837 : return (a.real == 0) && (a.imag == 0);
43838 : }
43839 41720 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
43840 41720 : __pyx_t_float_complex z;
43841 41720 : z.real = a.real;
43842 41720 : z.imag = -a.imag;
43843 41672 : return z;
43844 : }
43845 : #if 1
43846 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
43847 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
43848 : return sqrtf(z.real*z.real + z.imag*z.imag);
43849 : #else
43850 : return hypotf(z.real, z.imag);
43851 : #endif
43852 : }
43853 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
43854 : __pyx_t_float_complex z;
43855 : float r, lnr, theta, z_r, z_theta;
43856 : if (b.imag == 0 && b.real == (int)b.real) {
43857 : if (b.real < 0) {
43858 : float denom = a.real * a.real + a.imag * a.imag;
43859 : a.real = a.real / denom;
43860 : a.imag = -a.imag / denom;
43861 : b.real = -b.real;
43862 : }
43863 : switch ((int)b.real) {
43864 : case 0:
43865 : z.real = 1;
43866 : z.imag = 0;
43867 : return z;
43868 : case 1:
43869 : return a;
43870 : case 2:
43871 : return __Pyx_c_prod_float(a, a);
43872 : case 3:
43873 : z = __Pyx_c_prod_float(a, a);
43874 : return __Pyx_c_prod_float(z, a);
43875 : case 4:
43876 : z = __Pyx_c_prod_float(a, a);
43877 : return __Pyx_c_prod_float(z, z);
43878 : }
43879 : }
43880 : if (a.imag == 0) {
43881 : if (a.real == 0) {
43882 : return a;
43883 : } else if ((b.imag == 0) && (a.real >= 0)) {
43884 : z.real = powf(a.real, b.real);
43885 : z.imag = 0;
43886 : return z;
43887 : } else if (a.real > 0) {
43888 : r = a.real;
43889 : theta = 0;
43890 : } else {
43891 : r = -a.real;
43892 : theta = atan2f(0.0, -1.0);
43893 : }
43894 : } else {
43895 : r = __Pyx_c_abs_float(a);
43896 : theta = atan2f(a.imag, a.real);
43897 : }
43898 : lnr = logf(r);
43899 : z_r = expf(lnr * b.real - theta * b.imag);
43900 : z_theta = theta * b.real + lnr * b.imag;
43901 : z.real = z_r * cosf(z_theta);
43902 : z.imag = z_r * sinf(z_theta);
43903 : return z;
43904 : }
43905 : #endif
43906 : #endif
43907 :
43908 : /* Declarations */
43909 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
43910 : #ifdef __cplusplus
43911 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
43912 : return ::std::complex< double >(x, y);
43913 : }
43914 : #else
43915 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
43916 : return x + y*(__pyx_t_double_complex)_Complex_I;
43917 : }
43918 : #endif
43919 : #else
43920 2764 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
43921 2764 : __pyx_t_double_complex z;
43922 69904 : z.real = x;
43923 46192 : z.imag = y;
43924 307 : return z;
43925 : }
43926 : #endif
43927 :
43928 : /* Arithmetic */
43929 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
43930 : #else
43931 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
43932 : return (a.real == b.real) && (a.imag == b.imag);
43933 : }
43934 299 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
43935 299 : __pyx_t_double_complex z;
43936 299 : z.real = a.real + b.real;
43937 299 : z.imag = a.imag + b.imag;
43938 299 : return z;
43939 : }
43940 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
43941 : __pyx_t_double_complex z;
43942 : z.real = a.real - b.real;
43943 : z.imag = a.imag - b.imag;
43944 : return z;
43945 : }
43946 862 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
43947 862 : __pyx_t_double_complex z;
43948 862 : z.real = a.real * b.real - a.imag * b.imag;
43949 862 : z.imag = a.real * b.imag + a.imag * b.real;
43950 684 : return z;
43951 : }
43952 : #if 1
43953 1681 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
43954 1681 : if (b.imag == 0) {
43955 1681 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
43956 0 : } else if (fabs(b.real) >= fabs(b.imag)) {
43957 0 : if (b.real == 0 && b.imag == 0) {
43958 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
43959 : } else {
43960 0 : double r = b.imag / b.real;
43961 0 : double s = (double)(1.0) / (b.real + b.imag * r);
43962 0 : return __pyx_t_double_complex_from_parts(
43963 0 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
43964 : }
43965 : } else {
43966 0 : double r = b.real / b.imag;
43967 0 : double s = (double)(1.0) / (b.imag + b.real * r);
43968 0 : return __pyx_t_double_complex_from_parts(
43969 0 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
43970 : }
43971 : }
43972 : #else
43973 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
43974 : if (b.imag == 0) {
43975 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
43976 : } else {
43977 : double denom = b.real * b.real + b.imag * b.imag;
43978 : return __pyx_t_double_complex_from_parts(
43979 : (a.real * b.real + a.imag * b.imag) / denom,
43980 : (a.imag * b.real - a.real * b.imag) / denom);
43981 : }
43982 : }
43983 : #endif
43984 390 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
43985 390 : __pyx_t_double_complex z;
43986 390 : z.real = -a.real;
43987 390 : z.imag = -a.imag;
43988 58 : return z;
43989 : }
43990 776 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
43991 776 : return (a.real == 0) && (a.imag == 0);
43992 : }
43993 42268 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
43994 42268 : __pyx_t_double_complex z;
43995 42268 : z.real = a.real;
43996 42268 : z.imag = -a.imag;
43997 42220 : return z;
43998 : }
43999 : #if 1
44000 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
44001 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
44002 : return sqrt(z.real*z.real + z.imag*z.imag);
44003 : #else
44004 : return hypot(z.real, z.imag);
44005 : #endif
44006 : }
44007 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
44008 : __pyx_t_double_complex z;
44009 : double r, lnr, theta, z_r, z_theta;
44010 : if (b.imag == 0 && b.real == (int)b.real) {
44011 : if (b.real < 0) {
44012 : double denom = a.real * a.real + a.imag * a.imag;
44013 : a.real = a.real / denom;
44014 : a.imag = -a.imag / denom;
44015 : b.real = -b.real;
44016 : }
44017 : switch ((int)b.real) {
44018 : case 0:
44019 : z.real = 1;
44020 : z.imag = 0;
44021 : return z;
44022 : case 1:
44023 : return a;
44024 : case 2:
44025 : return __Pyx_c_prod_double(a, a);
44026 : case 3:
44027 : z = __Pyx_c_prod_double(a, a);
44028 : return __Pyx_c_prod_double(z, a);
44029 : case 4:
44030 : z = __Pyx_c_prod_double(a, a);
44031 : return __Pyx_c_prod_double(z, z);
44032 : }
44033 : }
44034 : if (a.imag == 0) {
44035 : if (a.real == 0) {
44036 : return a;
44037 : } else if ((b.imag == 0) && (a.real >= 0)) {
44038 : z.real = pow(a.real, b.real);
44039 : z.imag = 0;
44040 : return z;
44041 : } else if (a.real > 0) {
44042 : r = a.real;
44043 : theta = 0;
44044 : } else {
44045 : r = -a.real;
44046 : theta = atan2(0.0, -1.0);
44047 : }
44048 : } else {
44049 : r = __Pyx_c_abs_double(a);
44050 : theta = atan2(a.imag, a.real);
44051 : }
44052 : lnr = log(r);
44053 : z_r = exp(lnr * b.real - theta * b.imag);
44054 : z_theta = theta * b.real + lnr * b.imag;
44055 : z.real = z_r * cos(z_theta);
44056 : z.imag = z_r * sin(z_theta);
44057 : return z;
44058 : }
44059 : #endif
44060 : #endif
44061 :
44062 : /* CIntFromPyVerify */
44063 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
44064 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
44065 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
44066 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
44067 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
44068 : {\
44069 : func_type value = func_value;\
44070 : if (sizeof(target_type) < sizeof(func_type)) {\
44071 : if (unlikely(value != (func_type) (target_type) value)) {\
44072 : func_type zero = 0;\
44073 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
44074 : return (target_type) -1;\
44075 : if (is_unsigned && unlikely(value < zero))\
44076 : goto raise_neg_overflow;\
44077 : else\
44078 : goto raise_overflow;\
44079 : }\
44080 : }\
44081 : return (target_type) value;\
44082 : }
44083 :
44084 : /* Declarations */
44085 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
44086 : #ifdef __cplusplus
44087 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
44088 : return ::std::complex< long double >(x, y);
44089 : }
44090 : #else
44091 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
44092 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
44093 : }
44094 : #endif
44095 : #else
44096 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
44097 : __pyx_t_long_double_complex z;
44098 : z.real = x;
44099 : z.imag = y;
44100 : return z;
44101 : }
44102 : #endif
44103 :
44104 : /* Arithmetic */
44105 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
44106 : #else
44107 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
44108 : return (a.real == b.real) && (a.imag == b.imag);
44109 : }
44110 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
44111 : __pyx_t_long_double_complex z;
44112 : z.real = a.real + b.real;
44113 : z.imag = a.imag + b.imag;
44114 : return z;
44115 : }
44116 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
44117 : __pyx_t_long_double_complex z;
44118 : z.real = a.real - b.real;
44119 : z.imag = a.imag - b.imag;
44120 : return z;
44121 : }
44122 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
44123 : __pyx_t_long_double_complex z;
44124 : z.real = a.real * b.real - a.imag * b.imag;
44125 : z.imag = a.real * b.imag + a.imag * b.real;
44126 : return z;
44127 : }
44128 : #if 1
44129 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
44130 : if (b.imag == 0) {
44131 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
44132 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
44133 : if (b.real == 0 && b.imag == 0) {
44134 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
44135 : } else {
44136 : long double r = b.imag / b.real;
44137 : long double s = (long double)(1.0) / (b.real + b.imag * r);
44138 : return __pyx_t_long_double_complex_from_parts(
44139 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
44140 : }
44141 : } else {
44142 : long double r = b.real / b.imag;
44143 : long double s = (long double)(1.0) / (b.imag + b.real * r);
44144 : return __pyx_t_long_double_complex_from_parts(
44145 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
44146 : }
44147 : }
44148 : #else
44149 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
44150 : if (b.imag == 0) {
44151 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
44152 : } else {
44153 : long double denom = b.real * b.real + b.imag * b.imag;
44154 : return __pyx_t_long_double_complex_from_parts(
44155 : (a.real * b.real + a.imag * b.imag) / denom,
44156 : (a.imag * b.real - a.real * b.imag) / denom);
44157 : }
44158 : }
44159 : #endif
44160 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
44161 : __pyx_t_long_double_complex z;
44162 : z.real = -a.real;
44163 : z.imag = -a.imag;
44164 : return z;
44165 : }
44166 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
44167 : return (a.real == 0) && (a.imag == 0);
44168 : }
44169 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
44170 : __pyx_t_long_double_complex z;
44171 : z.real = a.real;
44172 : z.imag = -a.imag;
44173 : return z;
44174 : }
44175 : #if 1
44176 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
44177 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
44178 : return sqrtl(z.real*z.real + z.imag*z.imag);
44179 : #else
44180 : return hypotl(z.real, z.imag);
44181 : #endif
44182 : }
44183 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
44184 : __pyx_t_long_double_complex z;
44185 : long double r, lnr, theta, z_r, z_theta;
44186 : if (b.imag == 0 && b.real == (int)b.real) {
44187 : if (b.real < 0) {
44188 : long double denom = a.real * a.real + a.imag * a.imag;
44189 : a.real = a.real / denom;
44190 : a.imag = -a.imag / denom;
44191 : b.real = -b.real;
44192 : }
44193 : switch ((int)b.real) {
44194 : case 0:
44195 : z.real = 1;
44196 : z.imag = 0;
44197 : return z;
44198 : case 1:
44199 : return a;
44200 : case 2:
44201 : return __Pyx_c_prod_long__double(a, a);
44202 : case 3:
44203 : z = __Pyx_c_prod_long__double(a, a);
44204 : return __Pyx_c_prod_long__double(z, a);
44205 : case 4:
44206 : z = __Pyx_c_prod_long__double(a, a);
44207 : return __Pyx_c_prod_long__double(z, z);
44208 : }
44209 : }
44210 : if (a.imag == 0) {
44211 : if (a.real == 0) {
44212 : return a;
44213 : } else if ((b.imag == 0) && (a.real >= 0)) {
44214 : z.real = powl(a.real, b.real);
44215 : z.imag = 0;
44216 : return z;
44217 : } else if (a.real > 0) {
44218 : r = a.real;
44219 : theta = 0;
44220 : } else {
44221 : r = -a.real;
44222 : theta = atan2l(0.0, -1.0);
44223 : }
44224 : } else {
44225 : r = __Pyx_c_abs_long__double(a);
44226 : theta = atan2l(a.imag, a.real);
44227 : }
44228 : lnr = logl(r);
44229 : z_r = expl(lnr * b.real - theta * b.imag);
44230 : z_theta = theta * b.real + lnr * b.imag;
44231 : z.real = z_r * cosl(z_theta);
44232 : z.imag = z_r * sinl(z_theta);
44233 : return z;
44234 : }
44235 : #endif
44236 : #endif
44237 :
44238 : /* CIntFromPy */
44239 98380 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
44240 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44241 : #pragma GCC diagnostic push
44242 : #pragma GCC diagnostic ignored "-Wconversion"
44243 : #endif
44244 98380 : const int neg_one = (int) -1, const_zero = (int) 0;
44245 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44246 : #pragma GCC diagnostic pop
44247 : #endif
44248 98380 : const int is_unsigned = neg_one > const_zero;
44249 : #if PY_MAJOR_VERSION < 3
44250 : if (likely(PyInt_Check(x))) {
44251 : if ((sizeof(int) < sizeof(long))) {
44252 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
44253 : } else {
44254 : long val = PyInt_AS_LONG(x);
44255 : if (is_unsigned && unlikely(val < 0)) {
44256 : goto raise_neg_overflow;
44257 : }
44258 : return (int) val;
44259 : }
44260 : }
44261 : #endif
44262 98380 : if (unlikely(!PyLong_Check(x))) {
44263 0 : int val;
44264 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
44265 0 : if (!tmp) return (int) -1;
44266 0 : val = __Pyx_PyInt_As_int(tmp);
44267 0 : Py_DECREF(tmp);
44268 0 : return val;
44269 : }
44270 98380 : if (is_unsigned) {
44271 : #if CYTHON_USE_PYLONG_INTERNALS
44272 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
44273 : goto raise_neg_overflow;
44274 : } else if (__Pyx_PyLong_IsCompact(x)) {
44275 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
44276 : } else {
44277 : const digit* digits = __Pyx_PyLong_Digits(x);
44278 : assert(__Pyx_PyLong_DigitCount(x) > 1);
44279 : switch (__Pyx_PyLong_DigitCount(x)) {
44280 : case 2:
44281 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
44282 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
44283 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44284 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
44285 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
44286 : }
44287 : }
44288 : break;
44289 : case 3:
44290 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
44291 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
44292 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44293 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
44294 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
44295 : }
44296 : }
44297 : break;
44298 : case 4:
44299 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
44300 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
44301 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44302 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
44303 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
44304 : }
44305 : }
44306 : break;
44307 : }
44308 : }
44309 : #endif
44310 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
44311 : if (unlikely(Py_SIZE(x) < 0)) {
44312 : goto raise_neg_overflow;
44313 : }
44314 : #else
44315 : {
44316 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
44317 : if (unlikely(result < 0))
44318 : return (int) -1;
44319 : if (unlikely(result == 1))
44320 : goto raise_neg_overflow;
44321 : }
44322 : #endif
44323 : if ((sizeof(int) <= sizeof(unsigned long))) {
44324 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
44325 : #ifdef HAVE_LONG_LONG
44326 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
44327 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
44328 : #endif
44329 : }
44330 : } else {
44331 : #if CYTHON_USE_PYLONG_INTERNALS
44332 98380 : if (__Pyx_PyLong_IsCompact(x)) {
44333 98380 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
44334 : } else {
44335 0 : const digit* digits = __Pyx_PyLong_Digits(x);
44336 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
44337 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
44338 : case -2:
44339 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
44340 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
44341 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44342 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
44343 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
44344 : }
44345 : }
44346 : break;
44347 : case 2:
44348 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
44349 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
44350 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44351 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
44352 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
44353 : }
44354 : }
44355 : break;
44356 : case -3:
44357 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
44358 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
44359 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44360 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
44361 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
44362 : }
44363 : }
44364 : break;
44365 : case 3:
44366 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
44367 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
44368 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44369 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
44370 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
44371 : }
44372 : }
44373 : break;
44374 : case -4:
44375 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
44376 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
44377 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44378 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
44379 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
44380 : }
44381 : }
44382 : break;
44383 : case 4:
44384 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
44385 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
44386 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44387 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
44388 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
44389 : }
44390 : }
44391 : break;
44392 : }
44393 : }
44394 : #endif
44395 0 : if ((sizeof(int) <= sizeof(long))) {
44396 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
44397 : #ifdef HAVE_LONG_LONG
44398 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
44399 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
44400 : #endif
44401 : }
44402 : }
44403 : {
44404 : int val;
44405 : int ret = -1;
44406 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
44407 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
44408 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
44409 : if (unlikely(bytes_copied == -1)) {
44410 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
44411 : goto raise_overflow;
44412 : } else {
44413 : ret = 0;
44414 : }
44415 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
44416 : int one = 1; int is_little = (int)*(unsigned char *)&one;
44417 : unsigned char *bytes = (unsigned char *)&val;
44418 : ret = _PyLong_AsByteArray((PyLongObject *)x,
44419 : bytes, sizeof(val),
44420 : is_little, !is_unsigned);
44421 : #else
44422 : PyObject *v;
44423 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
44424 : int bits, remaining_bits, is_negative = 0;
44425 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
44426 : if (likely(PyLong_CheckExact(x))) {
44427 : v = __Pyx_NewRef(x);
44428 : } else {
44429 : v = PyNumber_Long(x);
44430 : if (unlikely(!v)) return (int) -1;
44431 : assert(PyLong_CheckExact(v));
44432 : }
44433 : {
44434 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
44435 : if (unlikely(result < 0)) {
44436 : Py_DECREF(v);
44437 : return (int) -1;
44438 : }
44439 : is_negative = result == 1;
44440 : }
44441 : if (is_unsigned && unlikely(is_negative)) {
44442 : Py_DECREF(v);
44443 : goto raise_neg_overflow;
44444 : } else if (is_negative) {
44445 : stepval = PyNumber_Invert(v);
44446 : Py_DECREF(v);
44447 : if (unlikely(!stepval))
44448 : return (int) -1;
44449 : } else {
44450 : stepval = v;
44451 : }
44452 : v = NULL;
44453 : val = (int) 0;
44454 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
44455 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
44456 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
44457 : PyObject *tmp, *digit;
44458 : long idigit;
44459 : digit = PyNumber_And(stepval, mask);
44460 : if (unlikely(!digit)) goto done;
44461 : idigit = PyLong_AsLong(digit);
44462 : Py_DECREF(digit);
44463 : if (unlikely(idigit < 0)) goto done;
44464 : val |= ((int) idigit) << bits;
44465 : tmp = PyNumber_Rshift(stepval, shift);
44466 : if (unlikely(!tmp)) goto done;
44467 : Py_DECREF(stepval); stepval = tmp;
44468 : }
44469 : Py_DECREF(shift); shift = NULL;
44470 : Py_DECREF(mask); mask = NULL;
44471 : {
44472 : long idigit = PyLong_AsLong(stepval);
44473 : if (unlikely(idigit < 0)) goto done;
44474 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
44475 : if (unlikely(idigit >= (1L << remaining_bits)))
44476 : goto raise_overflow;
44477 : val |= ((int) idigit) << bits;
44478 : }
44479 : if (!is_unsigned) {
44480 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
44481 : goto raise_overflow;
44482 : if (is_negative)
44483 : val = ~val;
44484 : }
44485 : ret = 0;
44486 : done:
44487 : Py_XDECREF(shift);
44488 : Py_XDECREF(mask);
44489 : Py_XDECREF(stepval);
44490 : #endif
44491 : if (unlikely(ret))
44492 : return (int) -1;
44493 : return val;
44494 : }
44495 0 : raise_overflow:
44496 0 : PyErr_SetString(PyExc_OverflowError,
44497 : "value too large to convert to int");
44498 0 : return (int) -1;
44499 : raise_neg_overflow:
44500 : PyErr_SetString(PyExc_OverflowError,
44501 : "can't convert negative value to int");
44502 : return (int) -1;
44503 : }
44504 :
44505 : /* CIntToPy */
44506 113001 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
44507 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44508 : #pragma GCC diagnostic push
44509 : #pragma GCC diagnostic ignored "-Wconversion"
44510 : #endif
44511 113001 : const int neg_one = (int) -1, const_zero = (int) 0;
44512 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44513 : #pragma GCC diagnostic pop
44514 : #endif
44515 113001 : const int is_unsigned = neg_one > const_zero;
44516 113001 : if (is_unsigned) {
44517 : if (sizeof(int) < sizeof(long)) {
44518 : return PyInt_FromLong((long) value);
44519 : } else if (sizeof(int) <= sizeof(unsigned long)) {
44520 : return PyLong_FromUnsignedLong((unsigned long) value);
44521 : #ifdef HAVE_LONG_LONG
44522 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
44523 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
44524 : #endif
44525 : }
44526 : } else {
44527 113001 : if (sizeof(int) <= sizeof(long)) {
44528 113001 : return PyInt_FromLong((long) value);
44529 : #ifdef HAVE_LONG_LONG
44530 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
44531 : return PyLong_FromLongLong((PY_LONG_LONG) value);
44532 : #endif
44533 : }
44534 : }
44535 : {
44536 : unsigned char *bytes = (unsigned char *)&value;
44537 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
44538 : if (is_unsigned) {
44539 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
44540 : } else {
44541 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
44542 : }
44543 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
44544 : int one = 1; int little = (int)*(unsigned char *)&one;
44545 : return _PyLong_FromByteArray(bytes, sizeof(int),
44546 : little, !is_unsigned);
44547 : #else
44548 : int one = 1; int little = (int)*(unsigned char *)&one;
44549 : PyObject *from_bytes, *result = NULL;
44550 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
44551 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
44552 : if (!from_bytes) return NULL;
44553 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
44554 : if (!py_bytes) goto limited_bad;
44555 : order_str = PyUnicode_FromString(little ? "little" : "big");
44556 : if (!order_str) goto limited_bad;
44557 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
44558 : if (!arg_tuple) goto limited_bad;
44559 : if (!is_unsigned) {
44560 : kwds = PyDict_New();
44561 : if (!kwds) goto limited_bad;
44562 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
44563 : }
44564 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
44565 : limited_bad:
44566 : Py_XDECREF(kwds);
44567 : Py_XDECREF(arg_tuple);
44568 : Py_XDECREF(order_str);
44569 : Py_XDECREF(py_bytes);
44570 : Py_XDECREF(from_bytes);
44571 : return result;
44572 : #endif
44573 : }
44574 : }
44575 :
44576 : /* CIntToPy */
44577 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
44578 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44579 : #pragma GCC diagnostic push
44580 : #pragma GCC diagnostic ignored "-Wconversion"
44581 : #endif
44582 : const long neg_one = (long) -1, const_zero = (long) 0;
44583 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44584 : #pragma GCC diagnostic pop
44585 : #endif
44586 : const int is_unsigned = neg_one > const_zero;
44587 : if (is_unsigned) {
44588 : if (sizeof(long) < sizeof(long)) {
44589 : return PyInt_FromLong((long) value);
44590 : } else if (sizeof(long) <= sizeof(unsigned long)) {
44591 : return PyLong_FromUnsignedLong((unsigned long) value);
44592 : #ifdef HAVE_LONG_LONG
44593 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
44594 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
44595 : #endif
44596 : }
44597 : } else {
44598 : if (sizeof(long) <= sizeof(long)) {
44599 : return PyInt_FromLong((long) value);
44600 : #ifdef HAVE_LONG_LONG
44601 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
44602 : return PyLong_FromLongLong((PY_LONG_LONG) value);
44603 : #endif
44604 : }
44605 : }
44606 : {
44607 : unsigned char *bytes = (unsigned char *)&value;
44608 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
44609 : if (is_unsigned) {
44610 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
44611 : } else {
44612 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
44613 : }
44614 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
44615 : int one = 1; int little = (int)*(unsigned char *)&one;
44616 : return _PyLong_FromByteArray(bytes, sizeof(long),
44617 : little, !is_unsigned);
44618 : #else
44619 : int one = 1; int little = (int)*(unsigned char *)&one;
44620 : PyObject *from_bytes, *result = NULL;
44621 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
44622 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
44623 : if (!from_bytes) return NULL;
44624 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
44625 : if (!py_bytes) goto limited_bad;
44626 : order_str = PyUnicode_FromString(little ? "little" : "big");
44627 : if (!order_str) goto limited_bad;
44628 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
44629 : if (!arg_tuple) goto limited_bad;
44630 : if (!is_unsigned) {
44631 : kwds = PyDict_New();
44632 : if (!kwds) goto limited_bad;
44633 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
44634 : }
44635 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
44636 : limited_bad:
44637 : Py_XDECREF(kwds);
44638 : Py_XDECREF(arg_tuple);
44639 : Py_XDECREF(order_str);
44640 : Py_XDECREF(py_bytes);
44641 : Py_XDECREF(from_bytes);
44642 : return result;
44643 : #endif
44644 : }
44645 : }
44646 :
44647 : /* CIntToPy */
44648 48612 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value) {
44649 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44650 : #pragma GCC diagnostic push
44651 : #pragma GCC diagnostic ignored "-Wconversion"
44652 : #endif
44653 48612 : const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
44654 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44655 : #pragma GCC diagnostic pop
44656 : #endif
44657 48612 : const int is_unsigned = neg_one > const_zero;
44658 48612 : if (is_unsigned) {
44659 : if (sizeof(npy_intp) < sizeof(long)) {
44660 : return PyInt_FromLong((long) value);
44661 : } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
44662 : return PyLong_FromUnsignedLong((unsigned long) value);
44663 : #ifdef HAVE_LONG_LONG
44664 : } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
44665 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
44666 : #endif
44667 : }
44668 : } else {
44669 48612 : if (sizeof(npy_intp) <= sizeof(long)) {
44670 48612 : return PyInt_FromLong((long) value);
44671 : #ifdef HAVE_LONG_LONG
44672 : } else if (sizeof(npy_intp) <= sizeof(PY_LONG_LONG)) {
44673 : return PyLong_FromLongLong((PY_LONG_LONG) value);
44674 : #endif
44675 : }
44676 : }
44677 : {
44678 : unsigned char *bytes = (unsigned char *)&value;
44679 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
44680 : if (is_unsigned) {
44681 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
44682 : } else {
44683 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
44684 : }
44685 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
44686 : int one = 1; int little = (int)*(unsigned char *)&one;
44687 : return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
44688 : little, !is_unsigned);
44689 : #else
44690 : int one = 1; int little = (int)*(unsigned char *)&one;
44691 : PyObject *from_bytes, *result = NULL;
44692 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
44693 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
44694 : if (!from_bytes) return NULL;
44695 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_intp));
44696 : if (!py_bytes) goto limited_bad;
44697 : order_str = PyUnicode_FromString(little ? "little" : "big");
44698 : if (!order_str) goto limited_bad;
44699 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
44700 : if (!arg_tuple) goto limited_bad;
44701 : if (!is_unsigned) {
44702 : kwds = PyDict_New();
44703 : if (!kwds) goto limited_bad;
44704 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
44705 : }
44706 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
44707 : limited_bad:
44708 : Py_XDECREF(kwds);
44709 : Py_XDECREF(arg_tuple);
44710 : Py_XDECREF(order_str);
44711 : Py_XDECREF(py_bytes);
44712 : Py_XDECREF(from_bytes);
44713 : return result;
44714 : #endif
44715 : }
44716 : }
44717 :
44718 : /* FormatTypeName */
44719 : #if CYTHON_COMPILING_IN_LIMITED_API
44720 : static __Pyx_TypeName
44721 : __Pyx_PyType_GetName(PyTypeObject* tp)
44722 : {
44723 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
44724 : __pyx_n_s_name);
44725 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
44726 : PyErr_Clear();
44727 : Py_XDECREF(name);
44728 : name = __Pyx_NewRef(__pyx_n_s__47);
44729 : }
44730 : return name;
44731 : }
44732 : #endif
44733 :
44734 : /* CIntFromPy */
44735 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
44736 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44737 : #pragma GCC diagnostic push
44738 : #pragma GCC diagnostic ignored "-Wconversion"
44739 : #endif
44740 : const long neg_one = (long) -1, const_zero = (long) 0;
44741 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
44742 : #pragma GCC diagnostic pop
44743 : #endif
44744 : const int is_unsigned = neg_one > const_zero;
44745 : #if PY_MAJOR_VERSION < 3
44746 : if (likely(PyInt_Check(x))) {
44747 : if ((sizeof(long) < sizeof(long))) {
44748 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
44749 : } else {
44750 : long val = PyInt_AS_LONG(x);
44751 : if (is_unsigned && unlikely(val < 0)) {
44752 : goto raise_neg_overflow;
44753 : }
44754 : return (long) val;
44755 : }
44756 : }
44757 : #endif
44758 : if (unlikely(!PyLong_Check(x))) {
44759 : long val;
44760 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
44761 : if (!tmp) return (long) -1;
44762 : val = __Pyx_PyInt_As_long(tmp);
44763 : Py_DECREF(tmp);
44764 : return val;
44765 : }
44766 : if (is_unsigned) {
44767 : #if CYTHON_USE_PYLONG_INTERNALS
44768 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
44769 : goto raise_neg_overflow;
44770 : } else if (__Pyx_PyLong_IsCompact(x)) {
44771 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
44772 : } else {
44773 : const digit* digits = __Pyx_PyLong_Digits(x);
44774 : assert(__Pyx_PyLong_DigitCount(x) > 1);
44775 : switch (__Pyx_PyLong_DigitCount(x)) {
44776 : case 2:
44777 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
44778 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
44779 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44780 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
44781 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
44782 : }
44783 : }
44784 : break;
44785 : case 3:
44786 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
44787 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
44788 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44789 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
44790 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
44791 : }
44792 : }
44793 : break;
44794 : case 4:
44795 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
44796 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
44797 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44798 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
44799 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
44800 : }
44801 : }
44802 : break;
44803 : }
44804 : }
44805 : #endif
44806 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
44807 : if (unlikely(Py_SIZE(x) < 0)) {
44808 : goto raise_neg_overflow;
44809 : }
44810 : #else
44811 : {
44812 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
44813 : if (unlikely(result < 0))
44814 : return (long) -1;
44815 : if (unlikely(result == 1))
44816 : goto raise_neg_overflow;
44817 : }
44818 : #endif
44819 : if ((sizeof(long) <= sizeof(unsigned long))) {
44820 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
44821 : #ifdef HAVE_LONG_LONG
44822 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
44823 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
44824 : #endif
44825 : }
44826 : } else {
44827 : #if CYTHON_USE_PYLONG_INTERNALS
44828 : if (__Pyx_PyLong_IsCompact(x)) {
44829 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
44830 : } else {
44831 : const digit* digits = __Pyx_PyLong_Digits(x);
44832 : assert(__Pyx_PyLong_DigitCount(x) > 1);
44833 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
44834 : case -2:
44835 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
44836 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
44837 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44838 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
44839 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
44840 : }
44841 : }
44842 : break;
44843 : case 2:
44844 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
44845 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
44846 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44847 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
44848 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
44849 : }
44850 : }
44851 : break;
44852 : case -3:
44853 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
44854 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
44855 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44856 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
44857 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
44858 : }
44859 : }
44860 : break;
44861 : case 3:
44862 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
44863 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
44864 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44865 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
44866 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
44867 : }
44868 : }
44869 : break;
44870 : case -4:
44871 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
44872 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
44873 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44874 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
44875 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
44876 : }
44877 : }
44878 : break;
44879 : case 4:
44880 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
44881 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
44882 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
44883 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
44884 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
44885 : }
44886 : }
44887 : break;
44888 : }
44889 : }
44890 : #endif
44891 : if ((sizeof(long) <= sizeof(long))) {
44892 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
44893 : #ifdef HAVE_LONG_LONG
44894 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
44895 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
44896 : #endif
44897 : }
44898 : }
44899 : {
44900 : long val;
44901 : int ret = -1;
44902 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
44903 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
44904 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
44905 : if (unlikely(bytes_copied == -1)) {
44906 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
44907 : goto raise_overflow;
44908 : } else {
44909 : ret = 0;
44910 : }
44911 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
44912 : int one = 1; int is_little = (int)*(unsigned char *)&one;
44913 : unsigned char *bytes = (unsigned char *)&val;
44914 : ret = _PyLong_AsByteArray((PyLongObject *)x,
44915 : bytes, sizeof(val),
44916 : is_little, !is_unsigned);
44917 : #else
44918 : PyObject *v;
44919 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
44920 : int bits, remaining_bits, is_negative = 0;
44921 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
44922 : if (likely(PyLong_CheckExact(x))) {
44923 : v = __Pyx_NewRef(x);
44924 : } else {
44925 : v = PyNumber_Long(x);
44926 : if (unlikely(!v)) return (long) -1;
44927 : assert(PyLong_CheckExact(v));
44928 : }
44929 : {
44930 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
44931 : if (unlikely(result < 0)) {
44932 : Py_DECREF(v);
44933 : return (long) -1;
44934 : }
44935 : is_negative = result == 1;
44936 : }
44937 : if (is_unsigned && unlikely(is_negative)) {
44938 : Py_DECREF(v);
44939 : goto raise_neg_overflow;
44940 : } else if (is_negative) {
44941 : stepval = PyNumber_Invert(v);
44942 : Py_DECREF(v);
44943 : if (unlikely(!stepval))
44944 : return (long) -1;
44945 : } else {
44946 : stepval = v;
44947 : }
44948 : v = NULL;
44949 : val = (long) 0;
44950 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
44951 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
44952 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
44953 : PyObject *tmp, *digit;
44954 : long idigit;
44955 : digit = PyNumber_And(stepval, mask);
44956 : if (unlikely(!digit)) goto done;
44957 : idigit = PyLong_AsLong(digit);
44958 : Py_DECREF(digit);
44959 : if (unlikely(idigit < 0)) goto done;
44960 : val |= ((long) idigit) << bits;
44961 : tmp = PyNumber_Rshift(stepval, shift);
44962 : if (unlikely(!tmp)) goto done;
44963 : Py_DECREF(stepval); stepval = tmp;
44964 : }
44965 : Py_DECREF(shift); shift = NULL;
44966 : Py_DECREF(mask); mask = NULL;
44967 : {
44968 : long idigit = PyLong_AsLong(stepval);
44969 : if (unlikely(idigit < 0)) goto done;
44970 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
44971 : if (unlikely(idigit >= (1L << remaining_bits)))
44972 : goto raise_overflow;
44973 : val |= ((long) idigit) << bits;
44974 : }
44975 : if (!is_unsigned) {
44976 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
44977 : goto raise_overflow;
44978 : if (is_negative)
44979 : val = ~val;
44980 : }
44981 : ret = 0;
44982 : done:
44983 : Py_XDECREF(shift);
44984 : Py_XDECREF(mask);
44985 : Py_XDECREF(stepval);
44986 : #endif
44987 : if (unlikely(ret))
44988 : return (long) -1;
44989 : return val;
44990 : }
44991 : raise_overflow:
44992 : PyErr_SetString(PyExc_OverflowError,
44993 : "value too large to convert to long");
44994 : return (long) -1;
44995 : raise_neg_overflow:
44996 : PyErr_SetString(PyExc_OverflowError,
44997 : "can't convert negative value to long");
44998 : return (long) -1;
44999 : }
45000 :
45001 : /* FastTypeChecks */
45002 : #if CYTHON_COMPILING_IN_CPYTHON
45003 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
45004 0 : while (a) {
45005 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
45006 0 : if (a == b)
45007 : return 1;
45008 : }
45009 0 : return b == &PyBaseObject_Type;
45010 : }
45011 145476 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
45012 145476 : PyObject *mro;
45013 145476 : if (a == b) return 1;
45014 0 : mro = a->tp_mro;
45015 0 : if (likely(mro)) {
45016 0 : Py_ssize_t i, n;
45017 0 : n = PyTuple_GET_SIZE(mro);
45018 0 : for (i = 0; i < n; i++) {
45019 0 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
45020 : return 1;
45021 : }
45022 : return 0;
45023 : }
45024 145476 : return __Pyx_InBases(a, b);
45025 : }
45026 45102 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
45027 45102 : PyObject *mro;
45028 45102 : if (cls == a || cls == b) return 1;
45029 22130 : mro = cls->tp_mro;
45030 22130 : if (likely(mro)) {
45031 22130 : Py_ssize_t i, n;
45032 22130 : n = PyTuple_GET_SIZE(mro);
45033 66390 : for (i = 0; i < n; i++) {
45034 44260 : PyObject *base = PyTuple_GET_ITEM(mro, i);
45035 44260 : if (base == (PyObject *)a || base == (PyObject *)b)
45036 : return 1;
45037 : }
45038 : return 0;
45039 : }
45040 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
45041 : }
45042 : #if PY_MAJOR_VERSION == 2
45043 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
45044 : PyObject *exception, *value, *tb;
45045 : int res;
45046 : __Pyx_PyThreadState_declare
45047 : __Pyx_PyThreadState_assign
45048 : __Pyx_ErrFetch(&exception, &value, &tb);
45049 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
45050 : if (unlikely(res == -1)) {
45051 : PyErr_WriteUnraisable(err);
45052 : res = 0;
45053 : }
45054 : if (!res) {
45055 : res = PyObject_IsSubclass(err, exc_type2);
45056 : if (unlikely(res == -1)) {
45057 : PyErr_WriteUnraisable(err);
45058 : res = 0;
45059 : }
45060 : }
45061 : __Pyx_ErrRestore(exception, value, tb);
45062 : return res;
45063 : }
45064 : #else
45065 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
45066 0 : if (exc_type1) {
45067 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
45068 : } else {
45069 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
45070 : }
45071 : }
45072 : #endif
45073 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
45074 0 : Py_ssize_t i, n;
45075 0 : assert(PyExceptionClass_Check(exc_type));
45076 0 : n = PyTuple_GET_SIZE(tuple);
45077 : #if PY_MAJOR_VERSION >= 3
45078 0 : for (i=0; i<n; i++) {
45079 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
45080 : }
45081 : #endif
45082 0 : for (i=0; i<n; i++) {
45083 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
45084 : #if PY_MAJOR_VERSION < 3
45085 : if (likely(exc_type == t)) return 1;
45086 : #endif
45087 0 : if (likely(PyExceptionClass_Check(t))) {
45088 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
45089 : } else {
45090 0 : }
45091 : }
45092 : return 0;
45093 : }
45094 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
45095 0 : if (likely(err == exc_type)) return 1;
45096 0 : if (likely(PyExceptionClass_Check(err))) {
45097 0 : if (likely(PyExceptionClass_Check(exc_type))) {
45098 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
45099 0 : } else if (likely(PyTuple_Check(exc_type))) {
45100 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
45101 : } else {
45102 0 : }
45103 : }
45104 0 : return PyErr_GivenExceptionMatches(err, exc_type);
45105 : }
45106 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
45107 : assert(PyExceptionClass_Check(exc_type1));
45108 : assert(PyExceptionClass_Check(exc_type2));
45109 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
45110 : if (likely(PyExceptionClass_Check(err))) {
45111 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
45112 : }
45113 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
45114 : }
45115 : #endif
45116 :
45117 : /* CheckBinaryVersion */
45118 3 : static unsigned long __Pyx_get_runtime_version(void) {
45119 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
45120 3 : return Py_Version & ~0xFFUL;
45121 : #else
45122 : const char* rt_version = Py_GetVersion();
45123 : unsigned long version = 0;
45124 : unsigned long factor = 0x01000000UL;
45125 : unsigned int digit = 0;
45126 : int i = 0;
45127 : while (factor) {
45128 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
45129 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
45130 : ++i;
45131 : }
45132 : version += factor * digit;
45133 : if (rt_version[i] != '.')
45134 : break;
45135 : digit = 0;
45136 : factor >>= 8;
45137 : ++i;
45138 : }
45139 : return version;
45140 : #endif
45141 : }
45142 3 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
45143 3 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
45144 3 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
45145 : return 0;
45146 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
45147 : return 1;
45148 : {
45149 0 : char message[200];
45150 0 : PyOS_snprintf(message, sizeof(message),
45151 : "compile time Python version %d.%d "
45152 : "of module '%.100s' "
45153 : "%s "
45154 : "runtime version %d.%d",
45155 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
45156 : __Pyx_MODULE_NAME,
45157 : (allow_newer) ? "was newer than" : "does not match",
45158 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
45159 : );
45160 0 : return PyErr_WarnEx(NULL, message, 1);
45161 : }
45162 : }
45163 :
45164 : /* FunctionImport */
45165 : #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11
45166 : #define __PYX_HAVE_RT_ImportFunction_3_0_11
45167 180 : static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
45168 180 : PyObject *d = 0;
45169 180 : PyObject *cobj = 0;
45170 180 : union {
45171 : void (*fp)(void);
45172 : void *p;
45173 : } tmp;
45174 180 : d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
45175 180 : if (!d)
45176 0 : goto bad;
45177 180 : cobj = PyDict_GetItemString(d, funcname);
45178 180 : if (!cobj) {
45179 0 : PyErr_Format(PyExc_ImportError,
45180 : "%.200s does not export expected C function %.200s",
45181 : PyModule_GetName(module), funcname);
45182 0 : goto bad;
45183 : }
45184 180 : if (!PyCapsule_IsValid(cobj, sig)) {
45185 0 : PyErr_Format(PyExc_TypeError,
45186 : "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
45187 : PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
45188 0 : goto bad;
45189 : }
45190 180 : tmp.p = PyCapsule_GetPointer(cobj, sig);
45191 180 : *f = tmp.fp;
45192 180 : if (!(*f))
45193 0 : goto bad;
45194 180 : Py_DECREF(d);
45195 : return 0;
45196 0 : bad:
45197 0 : Py_XDECREF(d);
45198 0 : return -1;
45199 : }
45200 : #endif
45201 :
45202 : /* InitStrings */
45203 : #if PY_MAJOR_VERSION >= 3
45204 444 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
45205 444 : if (t.is_unicode | t.is_str) {
45206 444 : if (t.intern) {
45207 300 : *str = PyUnicode_InternFromString(t.s);
45208 144 : } else if (t.encoding) {
45209 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
45210 : } else {
45211 144 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
45212 : }
45213 : } else {
45214 0 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
45215 : }
45216 444 : if (!*str)
45217 : return -1;
45218 444 : if (PyObject_Hash(*str) == -1)
45219 : return -1;
45220 : return 0;
45221 : }
45222 : #endif
45223 3 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
45224 447 : while (t->p) {
45225 : #if PY_MAJOR_VERSION >= 3
45226 444 : __Pyx_InitString(*t, t->p);
45227 : #else
45228 : if (t->is_unicode) {
45229 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
45230 : } else if (t->intern) {
45231 : *t->p = PyString_InternFromString(t->s);
45232 : } else {
45233 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
45234 : }
45235 : if (!*t->p)
45236 : return -1;
45237 : if (PyObject_Hash(*t->p) == -1)
45238 : return -1;
45239 : #endif
45240 444 : ++t;
45241 : }
45242 3 : return 0;
45243 : }
45244 :
45245 : #include <string.h>
45246 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
45247 : size_t len = strlen(s);
45248 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
45249 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
45250 : return -1;
45251 : }
45252 : return (Py_ssize_t) len;
45253 : }
45254 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
45255 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
45256 : if (unlikely(len < 0)) return NULL;
45257 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
45258 : }
45259 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
45260 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
45261 : if (unlikely(len < 0)) return NULL;
45262 : return PyByteArray_FromStringAndSize(c_str, len);
45263 : }
45264 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
45265 : Py_ssize_t ignore;
45266 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
45267 : }
45268 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
45269 : #if !CYTHON_PEP393_ENABLED
45270 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
45271 : char* defenc_c;
45272 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
45273 : if (!defenc) return NULL;
45274 : defenc_c = PyBytes_AS_STRING(defenc);
45275 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
45276 : {
45277 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
45278 : char* c;
45279 : for (c = defenc_c; c < end; c++) {
45280 : if ((unsigned char) (*c) >= 128) {
45281 : PyUnicode_AsASCIIString(o);
45282 : return NULL;
45283 : }
45284 : }
45285 : }
45286 : #endif
45287 : *length = PyBytes_GET_SIZE(defenc);
45288 : return defenc_c;
45289 : }
45290 : #else
45291 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
45292 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
45293 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
45294 : if (likely(PyUnicode_IS_ASCII(o))) {
45295 : *length = PyUnicode_GET_LENGTH(o);
45296 : return PyUnicode_AsUTF8(o);
45297 : } else {
45298 : PyUnicode_AsASCIIString(o);
45299 : return NULL;
45300 : }
45301 : #else
45302 : return PyUnicode_AsUTF8AndSize(o, length);
45303 : #endif
45304 : }
45305 : #endif
45306 : #endif
45307 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
45308 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
45309 : if (
45310 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
45311 : __Pyx_sys_getdefaultencoding_not_ascii &&
45312 : #endif
45313 : PyUnicode_Check(o)) {
45314 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
45315 : } else
45316 : #endif
45317 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
45318 : if (PyByteArray_Check(o)) {
45319 : *length = PyByteArray_GET_SIZE(o);
45320 : return PyByteArray_AS_STRING(o);
45321 : } else
45322 : #endif
45323 : {
45324 : char* result;
45325 : int r = PyBytes_AsStringAndSize(o, &result, length);
45326 : if (unlikely(r < 0)) {
45327 : return NULL;
45328 : } else {
45329 : return result;
45330 : }
45331 : }
45332 : }
45333 96673 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
45334 96673 : int is_true = x == Py_True;
45335 96673 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
45336 22000 : else return PyObject_IsTrue(x);
45337 : }
45338 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
45339 : int retval;
45340 : if (unlikely(!x)) return -1;
45341 : retval = __Pyx_PyObject_IsTrue(x);
45342 : Py_DECREF(x);
45343 : return retval;
45344 : }
45345 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
45346 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
45347 : #if PY_MAJOR_VERSION >= 3
45348 0 : if (PyLong_Check(result)) {
45349 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
45350 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
45351 : "The ability to return an instance of a strict subclass of int is deprecated, "
45352 : "and may be removed in a future version of Python.",
45353 : result_type_name)) {
45354 0 : __Pyx_DECREF_TypeName(result_type_name);
45355 0 : Py_DECREF(result);
45356 0 : return NULL;
45357 : }
45358 : __Pyx_DECREF_TypeName(result_type_name);
45359 : return result;
45360 : }
45361 : #endif
45362 0 : PyErr_Format(PyExc_TypeError,
45363 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
45364 : type_name, type_name, result_type_name);
45365 0 : __Pyx_DECREF_TypeName(result_type_name);
45366 0 : Py_DECREF(result);
45367 : return NULL;
45368 : }
45369 0 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
45370 : #if CYTHON_USE_TYPE_SLOTS
45371 0 : PyNumberMethods *m;
45372 : #endif
45373 0 : const char *name = NULL;
45374 0 : PyObject *res = NULL;
45375 : #if PY_MAJOR_VERSION < 3
45376 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
45377 : #else
45378 0 : if (likely(PyLong_Check(x)))
45379 : #endif
45380 0 : return __Pyx_NewRef(x);
45381 : #if CYTHON_USE_TYPE_SLOTS
45382 0 : m = Py_TYPE(x)->tp_as_number;
45383 : #if PY_MAJOR_VERSION < 3
45384 : if (m && m->nb_int) {
45385 : name = "int";
45386 : res = m->nb_int(x);
45387 : }
45388 : else if (m && m->nb_long) {
45389 : name = "long";
45390 : res = m->nb_long(x);
45391 : }
45392 : #else
45393 0 : if (likely(m && m->nb_int)) {
45394 0 : name = "int";
45395 0 : res = m->nb_int(x);
45396 : }
45397 : #endif
45398 : #else
45399 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
45400 : res = PyNumber_Int(x);
45401 : }
45402 : #endif
45403 0 : if (likely(res)) {
45404 : #if PY_MAJOR_VERSION < 3
45405 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
45406 : #else
45407 0 : if (unlikely(!PyLong_CheckExact(res))) {
45408 : #endif
45409 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
45410 : }
45411 : }
45412 0 : else if (!PyErr_Occurred()) {
45413 0 : PyErr_SetString(PyExc_TypeError,
45414 : "an integer is required");
45415 : }
45416 : return res;
45417 : }
45418 0 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
45419 0 : Py_ssize_t ival;
45420 0 : PyObject *x;
45421 : #if PY_MAJOR_VERSION < 3
45422 : if (likely(PyInt_CheckExact(b))) {
45423 : if (sizeof(Py_ssize_t) >= sizeof(long))
45424 : return PyInt_AS_LONG(b);
45425 : else
45426 : return PyInt_AsSsize_t(b);
45427 : }
45428 : #endif
45429 0 : if (likely(PyLong_CheckExact(b))) {
45430 : #if CYTHON_USE_PYLONG_INTERNALS
45431 0 : if (likely(__Pyx_PyLong_IsCompact(b))) {
45432 0 : return __Pyx_PyLong_CompactValue(b);
45433 : } else {
45434 0 : const digit* digits = __Pyx_PyLong_Digits(b);
45435 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
45436 0 : switch (size) {
45437 : case 2:
45438 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
45439 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
45440 : }
45441 : break;
45442 : case -2:
45443 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
45444 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
45445 : }
45446 : break;
45447 : case 3:
45448 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
45449 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
45450 : }
45451 : break;
45452 : case -3:
45453 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
45454 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
45455 : }
45456 : break;
45457 : case 4:
45458 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
45459 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
45460 : }
45461 : break;
45462 : case -4:
45463 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
45464 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
45465 : }
45466 : break;
45467 : }
45468 : }
45469 : #endif
45470 0 : return PyLong_AsSsize_t(b);
45471 : }
45472 0 : x = PyNumber_Index(b);
45473 0 : if (!x) return -1;
45474 0 : ival = PyInt_AsSsize_t(x);
45475 0 : Py_DECREF(x);
45476 : return ival;
45477 : }
45478 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
45479 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
45480 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
45481 : #if PY_MAJOR_VERSION < 3
45482 : } else if (likely(PyInt_CheckExact(o))) {
45483 : return PyInt_AS_LONG(o);
45484 : #endif
45485 : } else {
45486 : Py_ssize_t ival;
45487 : PyObject *x;
45488 : x = PyNumber_Index(o);
45489 : if (!x) return -1;
45490 : ival = PyInt_AsLong(x);
45491 : Py_DECREF(x);
45492 : return ival;
45493 : }
45494 : }
45495 24306 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
45496 24306 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
45497 : }
45498 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
45499 : return PyInt_FromSize_t(ival);
45500 : }
45501 :
45502 :
45503 : /* #### Code section: utility_code_pragmas_end ### */
45504 : #ifdef _MSC_VER
45505 : #pragma warning( pop )
45506 : #endif
45507 :
45508 :
45509 :
45510 : /* #### Code section: end ### */
45511 : #endif /* Py_PYTHON_H */
|